Subject: bug#42210: bug#41890: 28.0.50; [PATCH]: Add bindings for project.el

From: Sean Whitton <[email-masked]>
Date: Thu, 23 Jul 2020 08:06:57 -0700

Hello Juri,

On Thu 23 Jul 2020 at 03:32AM +03, Juri Linkov wrote:

>>> While the prompt is active, the key '?' and 'C-h' could (and I think should)
>>> display a list of *ALL* available key bindings from the project keymap
>>> in the *Help* buffer (like e.g. 'query-replace' does after typing 'C-h').
>>
>> What would determine which of the bindings get shown in the prompt,
>> then, supposing there were too many to fit them all?
>
> Maybe it's possible to show all them by using 'read-char-choice' when only
> the initial letters are displayed in the prompt like "(f, g, d, v, s, ?): "
> or using 'read-answer' or 'read-multiple-choice', e.g.:
>
> (read-multiple-choice "Select project"
>                       '((?f "Find file")
>                         (?g "Find regexp")
>                         (?d "dired")
>                         (?v "vc-dir")
>                         (?s "shell")))

If we're only displaying single letters, then I'm not sure there is much
point in prompting at all?  Either someone knows what letter to press or
they don't -- in either case the prompt seems useless.

>>>> I do think we should avoid binding commands under C-x 4 where the
>>>> versions under C-x p would already display in another window -- I think
>>>> it is potentially quite confusing to have bindings with identical
>>>> behaviour under both C-x 4 p and C-x p.
>>>
>>> Shouldn't some key sequence force displaying the project buffer in the
>>> same window (when a version under C-x p displays it in another window)?
>>
>> It's hard to know what key sequence to use.
>
> Indeed, it's hard to find a key prefix analogous to 'C-x 4 1'.
> Maybe 'C-x 4 1 p'?

I'd be cautious about this, because it breaks the general semantics of
C-x 4 1.  It seems reasonable that someone might have a major-mode in
which 'p' displays another buffer, and then they might want to use C-x 4
1 to reuse the same window.

-- 
Sean Whitton