emacs-devel
[Top][All Lists]
Advanced

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

Re: Suggestions for improvements to the *Completions* buffer


From: Juri Linkov
Subject: Re: Suggestions for improvements to the *Completions* buffer
Date: Sat, 18 Dec 2021 19:40:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

> diff --git a/lisp/simple.el b/lisp/simple.el
> index a55df604c1..1521c325dc 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -8967,7 +8967,8 @@ completion-quit
>  (defun completion-kill-buffer ()
>    "Close the completion buffer and return to the minibuffer."
>    (interactive)
> -  (kill-buffer "*Completions*")
> +  (let ((win (get-buffer-window "*Completions*")))
> +    (when win (quit-window t win)))
>    (switch-to-minibuffer))

After fixing bug#52491, no more commands using switch-to-minibuffer
would be needed, so `q' can remain round to `quit-window', thus
doing what `delete-window' is customized to do.

>> Like currently `ESC ESC ESC' can close the completion window
>> by the special command `delete-completion-window', then the same
>> command could be bound to `[remap keyboard-quit]' as well.
>
> Sure, but what noticeable difference does this make?  It seems to me
> that quitting or killing the completion buffer doesn't amount to much of
> a difference, as *Completion* is rarely selected manually.
>
> The only case I can think of where the difference could matter, is when
> *Completion* is so large that you need to kill it.  But considering that
> even with "C-h o TAB" the difference appears to be indistinguishable.
> Quitting a window and requesting the came completion doesn't even reuse
> the existing buffer.

I see no difference, but maybe someone might want to use different commands
for quit-window: with and without kill-buffer (this will require a new command
`quit-window-kill-buffer').

> Seeing as <left> and <right> are bound to previous-completion and
> next-completion, maybe <up> and <down> could be used for
> completion/minibuffer switching?

Both pairs <left>/<right> and <up>/<down> are useful in multi-column
completions buffer.

> Or to take inspiration from Protesilaos's MCT package, that switches
> back to the minibuffer once next-completion and previous-completion
> reaches the end/beginning of the buffer, without quitting the window.
> With next-completion bound to TAB while TAB also jumps back to the
> completion buffer, it would behave to just by cycling.

This means no wrapping?  Or maybe wrapping through the minibuffer?



reply via email to

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