emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about completion behavior


From: Ergus
Subject: Re: Question about completion behavior
Date: Sun, 13 Mar 2022 19:50:56 +0100

On Sun, Mar 13, 2022 at 07:44:49PM +0200, Juri Linkov wrote:
Maybe better to have the whole string with all text properties
as the default value of 'completion-header-text-property-list'
that then could be renamed to e.g. 'completion-header-string'?

I don't know a simple way for creating a string with the properties in a
single call.  We may need a sort of wrapper function that initializes
the string and call set properties in a single call otherwise the user
may need to do it manually... Something like:

(defun make-text-with-properties (string properties)
       (let ((out string))
            (set-text-properties ...)
            out))

Any better idea?

Something like

 (defvar completion-header-format
   (propertize "%s possible completions:"
               'face 'shadow
               :help "Please select a completion")
   "Format of completion header.")

Interesting... I couldn't find the propertize function in the text
property section of the manual... Done.

The other detail is that there are 2 strings: "Possible completions are"
and "There are no possible completions of what you have typed."

In case of no completions it will be formatted to: "0 possible completions".

I am perfectly fine with that I was just wondering is anyone will
complain just becaus the previous message changed.

Regarding 'completion-lazy-count': it would be even better to allow
customization of this format like in 'icomplete-matches-format'
that was recently added in 28.1.

Probably the best is to join the two variables in
completion-header-string and allow it to have a %s for a count... I will
go in that way.

Is it OK?

It's OK, like above.

Thanks, please check/correct it.


reply via email to

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