From: Drew Adams <drew.adams@oracle.com>
To: "João Távora" <joaotavora@gmail.com>, 34083@debbugs.gnu.org
Cc: monnier@iro.umontreal.ca
Subject: bug#34083: 27.0.50; Default completion, if it exists, should always sort to top
Date: Tue, 15 Jan 2019 09:55:55 -0800 (PST) [thread overview]
Message-ID: <3e721c33-2c05-4e3c-97a9-2511d432a2f2@default> (raw)
In-Reply-To: <jjbimyq82gx.fsf@gmail.com>
> In completion-all-sorted-completions, completions are sorted according
> to recency of usage, which is a good idea.
>
> However, for calls to completing-read that are given a DEFAULT
> (actually
> DEF) argument, the sort order isn't very useful. It means that, when
> using icomplete for i.e. M-x describe-symbol on top of the symbol sort
>
> Describe symbol (default sort): { some-other-symbol | yet-another |
> sort }
> ^^^^^^^^^^^^^^^^^
> boldface
>
> This is very confusing in icomplete as "some-other-symbol" in the
> previous example is boldface and gives the idea of a default. It is
> the
> thing that minibuffer-force-complete-and-exit, bound to C-j, will
> complete to immediately. But since no text has been entered, C-m will
> make completion consider "sort" instead.
>
> Here's a recipe:
>
> Emacs -Q
> M-x icomplete-mode
> M-: (setq icomplete-show-matches-on-no-input t) RET
> type "sort"
> C-h o
>
> Verify that "sort" is the default but it doesn't visually in the
> "propects list". Instead "%" is made boldface and C-j and C-M-i will
> immediately complete to it.
>
> This inconsistency is easy to fix in minibuffer.el, as attached in a
> patch. After the patch, "sort" is sorted to the top.
>
> I couldn't figure exactly if there is an impact on non-icomplete.el
> usage of completion-all-sorted-completions, because I'm not familiar
> with that code. But since it was already using
> minibuffer-history-variable, I don't think this disturbs it much more
> than that.
>
> Naturally, this could be coded to work in icomplete-mode only, but
> doing that patch cleanly is much harder.
Not a good idea, IMHO. Do I really care? My own code
sorts completions differently, so I don't care with
that in mind. But for vanilla Emacs I do care.
The default value of `completing-read' has nothing
to do with the current sort order or the first
completion of that order. If someone thinks that
Ido or Icomplete needs massaging in this way then
that's where it should be done. Certainly not at
the level of `completing-read' or (even worse)
`minibuffer.el' (`completion-all-sorted-completions').
"boldface...gives the idea of a default" is an
Ido/Icomplete thing. If their UIs need clarifying
in this case then that's where to concentrate efforts.
For example, perhaps a different face should be used
when the default is not the first candidate. (No, I'm
not proposing that or any other change for these UIs.)
(I don't want to belabor this or put forth arguments
for why this is a bad idea. If the why is not clear
to others who read this bug thread, too bad.)
next prev parent reply other threads:[~2019-01-15 17:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 13:39 bug#34083: 27.0.50; Default completion, if it exists, should always sort to top João Távora
2019-01-15 17:55 ` Drew Adams [this message]
2019-01-15 18:25 ` João Távora
2019-01-15 18:45 ` Drew Adams
2019-01-25 22:27 ` João Távora
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e721c33-2c05-4e3c-97a9-2511d432a2f2@default \
--to=drew.adams@oracle.com \
--cc=34083@debbugs.gnu.org \
--cc=joaotavora@gmail.com \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.