emacs-devel
[Top][All Lists]
Advanced

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

Re: Updating *Completions* as you type


From: Eli Zaretskii
Subject: Re: Updating *Completions* as you type
Date: Sun, 15 Oct 2023 09:06:55 +0300

> From: sbaugh@catern.com
> Date: Sat, 14 Oct 2023 16:05:11 -0400
> 
> Yes, agreed.  Taking inspiration from zcomplete, I wrote this patch to
> provide just this feature, thoughts?

I tried this.  The update is slow (most probably because it works off
the post-command-hook), and the UX is therefore extremely unpleasant
if you type fast enough.

> +(defcustom completions-auto-update t
> +  "If non-nil, update the *Completions* buffer as you type.

Thus _must_ be nil by default.

> +(defconst completions-no-auto-update-commands
> +  '(previous-history-element
> +    next-history-element
> +    previous-line-or-history-element
> +    next-line-or-history-element
> +    completion-at-point
> +    minibuffer-complete-and-exit
> +    minibuffer-force-complete-and-exit
> +    minibuffer-next-completion
> +    minibuffer-previous-completion
> +    minibuffer-choose-completion)
> +  "Commands to skip updating *Completions*")

Why are those excluded?  And why is this a defconst, not a defvar or
defcustom?

> +    (while-no-input
> +      (let ((non-essential t))
                ^^^^^^^^^^^^^^^
Why?

> +        (when (and (get-buffer-window "*Completions*" 0)
> +                   (not (memq this-command 
> completions-no-auto-update-commands)))
> +          (redisplay)
             ^^^^^^^^^^^
Why do you need this?



reply via email to

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