Commit graph

130 commits

Author SHA1 Message Date
modula t. worm bc13b087e7 support S-DEL and C-DEL in *input-map* 2024-08-09 00:53:34 -05:00
David 9c7f0c70b8
Merge pull request #1164 from aartaka/input-refine-fuzzy
Add `input-refine-fuzzy` for fuzzy matching.
2023-12-23 10:23:34 -05:00
Artyom Bologov dc2c23d2b3 input(input-refine-fuzzy): Add for fuzzy matching.
This way, one can filter through the suggestions in a way that's
slightly better than prefix, but less powerful than regexp one.

The implementation is somewhat simplistic. In particular, it doesn't
check the order of space-separated parts and doesn't ensure
that all the matches are unique. Still, better than prefix matching.
2023-12-11 22:46:03 +04:00
Artyom Bologov e82d5af6c5 input: Export *input-refine-candidates-fn* for consistency.
input-refine-prefix and input-refine-regexp are already exported,
which makes a case for *input-refine-candidates-fn* export.
2023-12-11 22:33:09 +04:00
Timo Myyrä 4aa0ce9f1d chore: add C-i as alias of TAB in input-map
Follow emacs behaviour and allow C-i do same command as TAB.
2023-09-17 18:19:53 +03:00
Max Schillinger 1825d1a84a Enable pasting from the clipboard with Ctrl-v 2023-09-06 20:31:00 +02:00
David 228185430d
Merge pull request #979 from szos/support-dead-keys
Support dead keys in the input bar
2022-05-27 19:39:27 -04:00
szos e095218974 ensure that after inserting a char the dead key is cleared 2022-05-27 16:00:06 +02:00
szos cedf900a8d Add preliminary support for dead keys
This commit adds support for a single dead key in the input line. This allows
for character such as á to be input. However this is restricted to a single dead
key, and characters such as ḉ cannot be entered.
2022-05-27 15:33:42 +02:00
szos a46ced69d8 Added more descriptive docstrings/errors, added section to manual 2022-05-27 13:36:56 +02:00
szos 7ff65b7273 Exported functions needed by user, added check for valid display
When stumpwm is built, key structures are generated, which fails if *display* is
nil. This adds a check to keysym-requires-altgr to address that.
2022-05-27 13:00:33 +02:00
szos 256f47672a Add preliminary altgr support
This commit adds an altgr slot to the key structure, and defines an altgr
offset variable. The offset is used for people (such as myself) who have altgr
offsets that arent 2. A function is defined to register altgr as a modifier,
which will ensure that the function is-modifier will register altgr as a
modifier. Finally a function is defined to check if a specific keysym requires
altgr to be input.
2022-05-26 22:47:02 +02:00
utis 8189428f27 Let user escape y-or-n questions
(as in the quit-confirm prompt) without printing an error.
2022-02-19 16:08:14 +01:00
Mark Hudnall 631d4df9cc Add a hook for input candidate selection
This can be used to mark information about a selected compltion candidate for e.g. sorting
completions by frecency.
2021-03-25 00:51:36 -07:00
Mark Hudnall da2e5951cd Allow toggling visibility of input completion list when empty 2021-03-25 00:50:39 -07:00
Mark Hudnall 373ae71a1f Allow refining input completion candidates
Completion candidates during completing-read can now be refined in a customizable
way. The *input-refine-candidates-fn* can be set to customize candidate
refinement. This parameter can be used to filter or sort candidates in novel ways.

By default, completion candidates are refined by prefix in unsorted order to maintain
backwards compatibility. Another refinement function, input-refine-regexp, is
implemented, which provides similar behavior to select-from-menu. That is, it refines
candidates by splitting the input string by space and treating each word as a regexp
to be matched.
2021-02-23 12:38:53 -08:00
szos 4ca9e41b5d Revert emacs autocomplete & modified keybindings
Reverts commits 3554334, 3854587, 3c1fd2e, 6dc0bc8, c919e66, and c235ddd
2020-11-15 04:08:53 +01:00
Florian Margaine 7b7be7fd9b Don't lose focus when fetching completions
There's this really annoying issue when you have a lot of completions:
while it's displaying them, the focus is lost to the underlying
window. So if you type "fi" for firefox (in `<prefix>-!`), the "i" is
sent to the underlying window.

It may be due to me using a truetype font which is slower to render,
or the fact that a single letter will yield a lot of completion
candidates.

Either way, making sure we keep the focus during the whole insertion
solves this issue.
2020-06-02 22:02:34 -05:00
Nathan Shostek 35543344a9 checked for the wrong toggle state :/ 2020-03-07 21:11:06 +01:00
Nathan Shostek 38545872f5 fixed replacement of input line on spacebar press 2020-03-07 21:08:36 +01:00
Shozo 3c1fd2e02b
added a needed function for the new colon
added input-insert-space, which is bound to M-SPC in the new colon.
2020-03-07 17:36:12 +01:00
Shozo 6dc0bc8292
updated completion previews
forgot to add this function
2020-03-07 17:19:40 +01:00
Shozo c235ddd589
added functions to implement emacs-esq completion 2020-03-07 17:07:44 +01:00
Steve Losh 3a438ca21e Suppress displaying completions of "" and note truncated completion list
This patch does two (possibly controversial) things:

1. Suppress showing *all* possible completions when the user hasn't typed anything at all yet.
2. If the completion list is truncated to fit `*maximum-completions*`, replace the last completion with `... and N more`.

I added item 1 is because I find it very disconcerting to immediately
have a giant list of words immediately thrown at me when I open
a prompt.  It *is* cut down to fit `*maximum-completions*`, but that
means what I end up seeing is the first N alphabetical items every
single time, which doesn't seem super helpful.  This patch delays
showing the list of completions until the user has at least typed
*something*.

I added item 2 because if I get a list of completions that looks roughly
like it's around the maximum length I've set, I can't be sure whether
I'm seeing *all* my options or whether there are some I'm not seeing
because they were truncated off.
2020-01-24 14:06:02 -05:00
David 12900323a9
Merge pull request #729 from triclops200/master
Remove duplicates in the completion pane
2020-01-21 21:10:48 -05:00
Spenser Truex e0250fb169 Fix read-one-line loss of focus.
Read-one-line would lose focus, making it impossible to close.
2020-01-20 15:27:30 -08:00
Bryan Hoyle 5806144f48 Remove duplicates in the completion pane 2020-01-15 09:07:15 -05:00
Bryan Hoyle c91b7c9164 Use initial-input 2020-01-14 08:48:09 -05:00
Bryan Hoyle dfc5b39440 fix completion not working with functions again and fix overflow bug introduced by large numbers of completion options 2020-01-13 15:17:32 -05:00
Spenser Truex c1200818a3 Show completions with input function
Display possible completions in a drop-down list when using `completing-read`
2019-12-31 12:34:26 -08:00
Spenser Truex 035ca8dfac Make messages punctuation more uniform
* Message should end in a period, just like the ANSI spec for errors.
* Also should not end it a fresh line.
* When prompting for user input a colon is best.
2019-12-23 13:24:21 -08:00
Javier Olaechea 0ddebd14c1 Cleanup after 2cf7b54
Don't ungrab the keyboard in SHUTDOWN-INPUT-WINDOW. This used to be necessary
as SETUP-INPUT-WINDOW was responsibly for grabbing the keyboard. As of 2cf7b54
this is the responsibility of the WITH-FOCUS macro that grabs and ungrabs the
keyboard.

Remove unnecessary comments. DRAW-INPUT-BUCKET is self-explanatory and the
other comment was for a line that is no longer there.

Ref-COMMIT: 2cf7b54b92
2019-07-13 12:26:29 -05:00
Javier Olaechea 5cf32467b8 DRAW-INPUT-BUCKET: Refactor prompt-width calculation
There is no need to iterate twice over the lines.
2019-07-13 12:26:29 -05:00
Joram Schrijver 4dd7b0ce14 Make cyclic completion add a trailing space
This was the behaviour before 30110c2c5f.

I suspect it was removed because yes-or-no-p wouldn't properly handle
completed values with a trailing space. To fix that, this changes
yes-or-no-p to trim spaces.
2019-04-05 00:38:15 +02:00
Guillaume LE VAILLANT a0c0c7168f Improve search of modifier keys in get-modifier-map 2019-03-19 10:51:55 +01:00
Florian Margaine 5ffb95dc16 Use a separate variable for shell history than command history.
Fixes #24
2019-02-19 00:57:32 +01:00
Javier Olaechea a612ac0270 Simplify the implementation of ALL-MODIFIER-CODES 2018-12-19 20:29:45 -05:00
Vasily Postnicov a13db62a4d READ-ONE-LINE: Turn COMPLETIONS into a keyword argument
This keeps READ-ONE-line backwards compatible to changes prior
dae0422811. Currently both
ARGUMENT-POP-OR-READ and ARGUMENT-POP-REST-OR-READ are still being
called with the previous lambda list. Update the calls to the
READ-ONE-LINE that used the 'new' lambda list, COMPLETING-READ and
YES-OR-NO-P.

Closes #538
2018-12-16 18:46:15 -05:00
Daniel Rebelo de Oliveira 5ad6c9162b Typo fix 2018-12-13 20:24:57 -05:00
Daniel Rebelo de Oliveira 30110c2c5f Uncommented and fixed yes-or-no-p. Uncommented y-or-n-p. 2018-12-01 23:26:24 +00:00
Daniel Rebelo de Oliveira dae0422811 Added support for pluggable completion styles.
A completion style is anything that implements
input-completion-reset and input-completion-complete.

The default completion style is now called
input-completion-style-cyclic and can be constructed
with make-input-completion-style-cyclic.

Added special variable *input-completion-style*.
Its default value is (make-input-completion-style-cyclic)
to maintain the current behaviour.

Added a new style that instead of cycling through possible completions,
completes as much as is possible unambiguously and otherwise displays
a message window with the possible completions.
This style is called input-completion-style-unambiguous.
2018-10-21 17:17:29 +01:00
Florian Margaine ae32e0d4f1 Remove unused arguments.
Given that we use &allow-other-keys, the function can still be called
with all the keys appropriately. There's no need to blindly add the
argument to declare it as ignored.
2018-09-28 21:33:08 +02:00
Florian Margaine 37f9d5aeab Make fselect frames clickable. 2018-09-28 21:33:08 +02:00
Grayson Croom 00a0fa008a Replaced all tab characters with an appropriate number of spaces. 2017-12-20 14:32:38 -06:00
Florian Margaine 2d285802fe Add support for multi-lines prompt. 2017-12-03 22:48:51 -05:00
juki 0876492eae Set the input window height in SETUP-INPUT-WINDOW 2017-11-22 10:13:34 +02:00
juki 6ad3974b82 Use vertical padding for input prompts 2017-11-21 20:45:01 +02:00
Javier Olaechea 040a7b0066 Simplify the initialization of *INPUT-MAP*
Bind *INPUT-MAP* when it is declared instead of initializing it as NIL and then
updating it if NIL.
2017-07-29 12:12:59 -05:00
Karl F a67ddab0e0 Documentation typo fix: Capitalize new sentences 2017-06-12 11:32:59 -05:00
Joram Schrijver 53bc4eab3c Fix non-conformant LOOP breaking input windows
On CLISP, the variable X would be NIL in the FINALLY clause, causing
rendering of the cursor to fail.

Fixes #287
2017-01-10 00:33:27 +01:00