Subject: Re: bug#64799: [PATCH] Add 'project-prompt-key' face

From: Philip Kaludercic <[email-masked]>
Date: Tue, 25 Jul 2023 06:39:26 +0000

Dmitry Gutov <[email-masked]> writes:

> On 24/07/2023 08:53, Protesilaos Stavrou wrote:
>>> From: Philip Kaludercic <[email-masked]>
>>> Date: Sun, 23 Jul 2023 13:59:41 +0000
>> 
>>> [... 14 lines elided]
>> 
>>>>> Does this even need a separate face, or shouldn't `help-key-binding' be
>>>>> reused directly?
>>>>
>>>> That would be my choice, though also with the removal of the square
>>>> brackets around it.  The proposed patch is for backward-compatibility.
>>>
>>> Backwards-compatible to what?
>> Just so that existing users do not complain.
>> 
>>> Can someone depend on this specific behaviour?
>> No, but the appearance still comes with certain expectations.  Plus,
>> there is this at the top of the file:
>>      ;; This is a GNU ELPA :core package.  Avoid using functionality
>> that
>>      ;; not compatible with the version of Emacs recorded above
>> The required Emacs version is 26.1, while that of 'help-key-binding'
>> is
>> 28.1.
>
> Indeed, so if we switch to it in project.el, it will need some
> polyfill for Emacs 26-27.

If there is interest, this face could be added to the Compat package, if
it would be OK to add Compat as a dependency for project.el on ELPA
(this would also mean that project.el wouldn't have to use a custom
`project--buffer-check'/`buffer-match-p' implementation).

Alternatively, we could add a version/facep check and always prefer
`help-key-binding' if it is available, otherwise fall-back to the
current option.

>> Perhaps a user option for the whole 'format' would be better?
>
> We can add a user option. But while we could also apply 'face'
> property on that option's string value, that doesn't seem like a very
> user-friendly approach toward someone who will want to change the face
> used (it will require some Lisp knowledge from the user).
>
> But a user option to change how the prompt text is constructed -- why
> not. E.g. one defaulting to "[%s] %s".

Is there really such a wide range of options that users might be
interested in here?