emacs-devel
[Top][All Lists]
Advanced

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

Re: switch-to-completions


From: Juri Linkov
Subject: Re: switch-to-completions
Date: Wed, 18 Nov 2009 21:04:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu)

>> After scrolling with the help of `minibuffer-complete' or
>> `minibuffer-complete-backward' to the middle of a long list
>> of completions, and typing `M-v' or <prior> (bound to
>> `switch-to-completions') to select a completion item using
>> keyboard, point jumps to the beginning of the *Completions*
>> buffer, thus requiring to scroll to the middle of the list
>> again.  I suppose moving point to the first item is necessary
>> only in the new *Completions* buffer:
>
> Yes, that makes sense.  An alternative would be to make
> minibuffer-completion-help itself do the (search-forward "\n\n" nil t),
> which would seem to make more sense (e.g. minibuffer-completion-help is
> the function that fills the buffer and presumably knows that this \n\n
> exists and is it the right place, whereas switch-to-completions only can
> assume that minibuffer-completion-help places a \n\n at the right place).

I'm not sure what function should take care about finding the right place
since creation of the *Completions* buffer is shared among several functions:
`display-completion-list' inserts the text "Possible completions are:\n",
`completion-setup-function' inserts the help text with one newline or
two newlines depending on `(display-mouse-p)' or no help text if
`completion-show-help' is nil.  And there are many packages that
don't call `minibuffer-completion-help' - they use something like
(with-output-to-temp-buffer "*Completions*" (display-completion-list ...

Maybe `switch-to-completions' should simply call `(next-completion 1)'?
It seems this is the most reliable way to move point to the first completion.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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