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: Sun, 19 Dec 2021 19:18:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>>> The mechanism used to make backtab in the minibuffer switch to the last
>>> completion option is not that nice as it uses this-command and
>>> this-command-keys.
>>
>> When completion-auto-select is not enabled, TAB scrolls the completions 
>> buffer
>> forward.  So S-TAB (backtab) could scroll backward.
>>
>> When completion-auto-select will be enabled, backtab could switch to
>> the completions as well, indeed.
>
> How is this?

Thanks, this has now such a nice property that after typing TAB
that switches to the completions buffer, it's easy to switch back
to the minibuffer by typing S-TAB.  But this works only when
completion-wrap-movement is non-nil.

> +(defcustom completion-wrap-movement t
> +  "Non-nil means to wrap around when selecting completion options.
> +This affects the commands `next-completion' and
> +`previous-completion'."
> +  :type 'boolean
> +  :version "29.1"
> +  :group 'completion)

It seems now completion-wrap-movement has no effect:
typing n, p, <right> or <left> eventually switches to the minibuffer,
where continuing typing these keys uses other commands.

> (completion--in-region-1): Handle backtab to scroll backwards
> @@ -1386,7 +1386,9 @@ completion--in-region-1
>              (set-window-start window (point-min) nil)
>            ;; Else scroll down one screen.
>            (with-selected-window window
> -         (scroll-up)))
> +            (if (equal (this-command-keys) [backtab])
> +                (scroll-down)
> +              (scroll-up))))

Using S-TAB to scroll backwards also works nice.
The only difference with TAB is that while typing
several TABs reaches the end of the completions buffer,
typing more TABs wraps to the beginning of the completions
buffer, but S-TAB doesn't wrap to the end of the buffer.



reply via email to

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