emacs-devel
[Top][All Lists]
Advanced

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

Re: master 15ac51e0fd: Merge branch 'feature/completions-customs'


From: Ergus
Subject: Re: master 15ac51e0fd: Merge branch 'feature/completions-customs'
Date: Tue, 22 Mar 2022 18:05:00 +0100

On Tue, Mar 22, 2022 at 05:28:59PM +0800, Po Lu wrote:
Juri Linkov <juri@jurta.org> writes:

+(defcustom completions-header-format
+  (propertize "%s possible completions:\n"
+              'face 'shadow
+              :help "Please select a completion")
+  "Format of completions header.
+It may contain one %s to show the total count of completions.
+When nil, no header is shown."
+  :type '(choice (const :tag "No header" nil)
+                 (string :tag "Header format string"))
+  :version "29.1")

IHMO this should be off by default.  It wastes a line of space in the
completions buffer for no real gain, and it's distracting.

The header was already there so no new space
wasted... completion-show-help is nil in my system... I didn't add it to
the modeline to make it simpler...

BUT: we could add a completions-header-format special value 'modeline
and then show there the count of completions... I am not interested at
all because in my system y hide the mode-line for completions....

Also, I don't know which part of this change causes the following
behavior, but if I say M-x and then press TAB twice, the item at the
start of the window displaying the completions buffer becomes
highlighted, even though it isn't selected.  That should also be off by
default, since it's an unnecessary visual distraction.


Ok I think I know... I haven't observed this before...

The completions-highlight-mode relies on the new cursor-face that shows
the highlight when the cursor is over the text...

It seems that when M-x <tab> <tab>
according to completion--in-region-1 the second <tab> scrolls the
Completions buffer, so the cursor goes to the start of the screen after
the scroll, as there is a candidate, that's why you see it
highlighted...

I suggest two solutions here:

1) Not enable cursor-face-highlight-nonselected-window for
completions... this will disable the highlight whenever the Completions
window is not the active one...

2) Extend the highlight to consider cursor-in-non-selected-windows and
set it to nil in Completions by default...

The first is the simples one, but will fore the Juri's code to
setq-local the variable in a hook or in his function wrapper...

So just tell what do you prefer...


Thanks.



reply via email to

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