unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: switch-to-completions
Date: Wed, 18 Nov 2009 21:04:36 +0200	[thread overview]
Message-ID: <87einv3e14.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwvmy2jj0or.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 18 Nov 2009 10:48:42 -0500")

>> 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	other threads:[~2009-11-18 19:04 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11 19:45 completions - remove window after use? David Reitter
2009-11-11 20:28 ` Stefan Monnier
2009-11-11 21:26   ` Štěpán Němec
2009-11-11 23:21     ` Stefan Monnier
2009-11-12  9:57       ` Vertical completions (was: completions - remove window after use?) Juri Linkov
2009-11-12 10:09         ` Deniz Dogan
2009-11-17 17:45           ` Vertical completions Juri Linkov
2009-11-18  8:11             ` martin rudalics
2009-11-18  9:59               ` Juri Linkov
2009-11-18  9:47             ` Backward completions (was: Vertical completions) Juri Linkov
2009-11-18 15:06               ` Drew Adams
2009-11-18 15:47                 ` Lennart Borgman
2009-11-18 19:02                   ` Backward completions Juri Linkov
2009-11-18 19:36                     ` Lennart Borgman
2009-11-19 17:36                       ` Juri Linkov
2009-11-19 17:58                         ` Lennart Borgman
2009-11-19 18:24                         ` Drew Adams
2009-11-20  9:27                           ` Juri Linkov
2009-11-20 17:29                           ` Juri Linkov
2009-11-20 17:49                             ` Lennart Borgman
2009-11-20 21:26                             ` Drew Adams
2009-11-18 15:45               ` Stefan Monnier
2009-11-18 19:01                 ` Juri Linkov
2009-11-18 19:50               ` Backward completions (was: Vertical completions) Dan Nicolaescu
2009-11-19 17:32                 ` Backward completions Juri Linkov
2009-11-19 18:29                   ` Dan Nicolaescu
2009-11-19 18:36                     ` Drew Adams
2009-11-19 19:26                       ` Dan Nicolaescu
2009-11-19 19:30                         ` Drew Adams
2009-11-18  9:52             ` switch-to-completions (was: Vertical completions) Juri Linkov
2009-11-18 15:48               ` switch-to-completions Stefan Monnier
2009-11-18 19:04                 ` Juri Linkov [this message]
2009-11-19  1:12                   ` switch-to-completions Stefan Monnier
2009-11-12 10:29         ` Vertical completions (was: completions - remove window after use?) Štěpán Němec
2009-11-12 19:26         ` Eli Zaretskii
2009-11-12 22:00           ` Lennart Borgman
2009-11-12 13:30       ` completions - remove window after use? Lluís
2009-11-12 14:40         ` David Reitter
2009-11-12 15:15         ` Stefan Monnier
2009-11-14  0:30           ` Richard Stallman
2009-11-12  3:00 ` Xavier Maillard
2009-11-12  8:19 ` martin rudalics
2009-11-12 22:36   ` Xavier Maillard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87einv3e14.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).