emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature/completions-highlight-modifications e3c5b99 3/6: Add complet


From: Ergus
Subject: Re: feature/completions-highlight-modifications e3c5b99 3/6: Add completions-highlight-mode initial implementation.
Date: Sun, 22 Nov 2020 14:28:33 +0100

On Sat, Nov 21, 2020 at 09:30:17PM +0200, Juri Linkov wrote:
Maybe we should look more how zsh behaves... and try to mimic that as
much as possible. Because it is already pretty consisten

Does zsh use arrow keys to navigate in completions?
How then it's possible to get previous/next history item (up/down arrows),
and move the cursor in the command line (left/right arrows)?

Similar to what we are doing.

1) When NO completions shown: previous/next history and so on.
2) When completions are shown: navigate completions.

Completions are only shown after a "tab request" 1->2 (unlike
incomplete)

Trying to mimic the 'zsh' behavior is a good thing.  Using
'zsh' as a reference, what do you think about naming the package
'zcomplete'.

Ok

If you type any letter completions disappear, inserts a space and then
the letter, so

backspace just hides completions (deletes the inserted space), so goes
from 2->1 easily (unlike *Completions*).

If you want to emulate the 'zsh' behavior, then much simpler approach
would be to allow TAB to pop-up the completions buffer, i.e. to display
and switch to it.  Then all motion keys will be available by default.
To display the cursor in the minibuffer is still possible by using
'(cursor-in-echo-area t)'.  RET will insert the completion under point
to the minibuffer.  Any self-inserting key could switch back
to the minibuffer and insert its character.

The real issue with that is not setting, but reseting. Because
completions-list-map uses:

1. \e\e\e delete-completion-window
2. q quit-window
3. z kill-current-buffer

to exit. In principle quit-window-hook works for 2. But for 1 we need
an advise and rebind q and 3 is bind to z. so
I am not clear what's the best approach or the consequences of changing
them. But my proposal will be then make:
q and z: self-insert (as they will call quit-window in the hook any way).

And rebind
C-g: to kill-current-buffer. (I don't really know the difference between
all them)

The hook for self-insert is trivial. But it won't cover commands like
delete-backward-char, backward-kill-word and so on.

The trick there may be to throw the read-only error and call 1, 2 or
3... to go to the minibuffer when any command tries to modify
"Completions* and try to execute there.

But I don't know if it is possible to do that for a whole buffer or a
map in a clean way and locally to a window/buffer only. Is it?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]