unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@catern.com>
Cc: juri@linkov.net, emacs-devel@gnu.org
Subject: Re: Navigating completions from minibuffer
Date: Sat, 25 Nov 2023 18:08:44 +0200	[thread overview]
Message-ID: <83ttp9bysz.fsf@gnu.org> (raw)
In-Reply-To: <87sf4tj1xw.fsf@catern.com> (message from Spencer Baugh on Sat, 25 Nov 2023 15:19:37 +0000 (UTC))

> From: Spencer Baugh <sbaugh@catern.com>
> Date: Sat, 25 Nov 2023 15:19:37 +0000 (UTC)
> Cc: emacs-devel@gnu.org
> 
> +(defcustom completions-auto-update 'deselect
> +  "If non-nil, change the *Completions* buffer as you type.
                  ^^^^^^
"Update", not "change".

> +If `deselect', if a completion candidate in *Completions* is
> +selected (point is on it), it will be deselected (point will be
> +moved just before it) when the minibuffer point or contents
> +change.

This has several issues.

First, "If `deselect'" is sub-optimal; it is better to say

  The value of `deselect' means that ...

The double "if" ("If `deselect', if a completion candidate...") is
also sub-optimal.  At the very least, if you need to say something
like that, say

  If this, then if that, ...

Finally, I'm guessing that the value `deselect' means to deslect the
candidate _in_addition_to_ update "*Completions*" as the user types.
If my guess is correct, please say

  The value of `deselect' means that in addition to updating
  *Completions*, the selected candidate will be deselected...

> +This only affects the *Completions* buffer if it is already
> +displayed."

Not sure what this sentence adds.  What will happen if you drop it?

> +  :type '(choice (const :tag "*Completions* doesn't change as you type" nil)
> +                 (const :tag "Typing deselects any completion candidate in *Completions*" deselect))

And now I see that my guess above perhaps was wrong: there's no value
t in the choice?  Then why not make this a simple boolean?

> +(defun completions--deselect ()
> +  "If in a completion candidate, move to just after the end of it.
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"If point is at a completion candidate, ..."

> +(defun completions--post-command ()
> +  "Update displayed *Completions* buffer after change in minibuffer point."
> +  (when (and (minibufferp) (not (eq minibuffer--old-point (point))))
> +    (setq minibuffer--old-point (point))
> +    (unless (and completions-auto-update
> +                 (memq this-command '(minibuffer-next-completion minibuffer-previous-completion)))
> +      (completions--update-if-displayed))))

Ugh, another post-command hook...  It is small wonder users complain
that Emacs is slow to respond and feels sluggish.  What will happen if
the user types fast?  Could there be a design that doesn't use
post-command-hook?



  reply	other threads:[~2023-11-25 16:08 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07  3:57 Navigating completions from minibuffer T.V Raman
2023-11-07  4:55 ` T.V Raman
2023-11-07  7:20   ` Juri Linkov
2023-11-07 17:53     ` T.V Raman
2023-11-07 19:36       ` T.V Raman
2023-11-08  7:39         ` Juri Linkov
2023-11-08 16:21           ` T.V Raman
2023-11-08 17:18             ` T.V Raman
2023-11-08 22:11               ` Slow completion-at-point was " T.V Raman
2023-11-09  7:22                 ` Slow completion-at-point Juri Linkov
2023-11-09 12:10                   ` Dmitry Gutov
2023-11-09 16:20                     ` Juri Linkov
2023-11-09 18:32                       ` João Távora
2023-11-11  2:48                     ` T.V Raman
2023-11-11 10:36                       ` Dmitry Gutov
2023-11-11 16:40                         ` T.V Raman
2023-11-11 19:00                           ` Juri Linkov
2023-11-11 19:43                             ` T.V Raman
2023-11-11 21:50                               ` Dmitry Gutov
2023-11-09 15:39                   ` T.V Raman
2023-11-09 12:20                 ` Slow completion-at-point was Re: Navigating completions from minibuffer Dmitry Gutov
2023-11-09 15:41                   ` T.V Raman
2023-11-09 17:46                 ` T.V Raman
2023-11-10 13:12           ` Spencer Baugh
2023-11-11 18:58             ` Juri Linkov
2023-11-14  7:36               ` Juri Linkov
2023-11-15 21:40                 ` Spencer Baugh
2023-11-16 17:15                   ` T.V Raman
2023-11-15 22:03                 ` Spencer Baugh
2023-11-16  7:16                   ` Juri Linkov
2023-11-16 14:41                     ` Spencer Baugh
2023-11-16 17:28                       ` Juri Linkov
2023-11-16 18:25                         ` Spencer Baugh
2023-11-17  7:09                           ` Juri Linkov
2023-11-17 17:22                             ` Spencer Baugh
2023-11-18 20:58                               ` sbaugh
2023-11-19  7:08                                 ` Juri Linkov
2023-11-19  8:19                                   ` Eli Zaretskii
2023-11-19 14:41                                   ` Spencer Baugh
2023-11-19 18:01                                     ` Juri Linkov
2023-11-19 19:41                                       ` Spencer Baugh
2023-11-20  2:58                                       ` Spencer Baugh
2023-11-23 13:39                                     ` sbaugh
2023-11-24  7:54                                       ` Juri Linkov
2023-11-25 15:19                                         ` Spencer Baugh
2023-11-25 16:08                                           ` Eli Zaretskii [this message]
2023-11-25 18:23                                             ` sbaugh
2023-11-25 18:48                                               ` Juri Linkov
2023-11-26 13:10                                                 ` sbaugh
2023-11-25 19:00                                               ` Eli Zaretskii
2023-11-25 17:46                                           ` Juri Linkov
2023-11-26 14:33                                             ` Spencer Baugh
2023-11-27  7:22                                               ` Juri Linkov
2023-11-28 14:48                                                 ` Spencer Baugh
2023-11-28 17:23                                                   ` Juri Linkov
2023-11-29  0:20                                                     ` Spencer Baugh
2023-12-03 17:21                                                       ` Juri Linkov
2023-12-03 18:13                                                         ` Eli Zaretskii
2023-12-06 17:20                                                           ` Juri Linkov
2023-12-06 17:50                                                             ` Eli Zaretskii
2023-12-07  7:44                                                               ` Juri Linkov
2023-12-08  8:46                                                                 ` Eli Zaretskii

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=83ttp9bysz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=sbaugh@catern.com \
    /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).