emacs-devel
[Top][All Lists]
Advanced

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

Re: Select completions from the minibuffer


From: Juri Linkov
Subject: Re: Select completions from the minibuffer
Date: Tue, 22 Mar 2022 19:52:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

> I see that setting cursor-face-highlight-nonselected-window to t by
> default produces a highlight a bit annoying for some users...
>
> So I think that we may disable it and problem solved.
>
> For your selection from minibuffer I am not sure how you plan to enable
> it, but I suppose you will make a minor mode, so instead of setq-local
> on every call probably you will prefer to do something like:
>
> (defun minibuffer-select-completion-setup-function ()
>    (with-current-buffer standard-output
>       (when completions-highlight-face
>         (setq-local cursor-face-highlight-nonselected-window t))))
>
> (add-hook 'completion-setup-hook 
> #'minibuffer-select-completion-setup-function)
>
> Is it fine for you?

Actually, such highlighting in non-selected completions window is needed
only for new commands that use the new macro with-minibuffer-completions-window,
because this macro navigates completions in the non-selected window,
so this works fine:

```
(defun minibuffer-previous-completion (&optional n)
  "Run `previous-completion' from the minibuffer in its completions window."
  (interactive "p")
  (with-minibuffer-completions-window
    (let ((completion-wrap-movement nil))
      (setq-local cursor-face-highlight-nonselected-window t)
      (previous-completion n))))
```



reply via email to

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