Subject: bug#52053: 29.0.50; Nonsensical button "C-x C-f" in scratch buffer

From: Eli Zaretskii <[email-masked]>
Date: Thu, 25 Nov 2021 16:16:18 +0200

> Date: Thu, 25 Nov 2021 13:41:50 +0000
> From: Gregory Heytings <[email-masked]>
> cc: [email-masked], [email-masked], [email-masked]
> 
> AFAICS, the options are:
> 
> 1. Detect inside substitute-command-keys whether the string is for a 
> *Help* buffer.  That's what the patch does, it's the simplest solution 
> from the point of view of those who call s-c-k.
> 
> 2. Add an optional parameter to s-c-k to indicate whether the string is 
> for a non-*Help* buffer.  That's a reasonable alternative, but there are 
> ~450 calls to s-c-k in the trunk, each would have to be checked.
> 
> 3. Add a variable and let-bind it around the calls to s-c-k to indicate 
> when the string is for a non-*Help* buffer.
> 
> 4. Let-bind help-link-key-to-documentation to nil around the calls to 
> s-c-k to indicate that the calls to help-mode--add-function-link should be 
> skipped.  ISTM that this is not generic enough, if in six months we had 
> another similar feature it would be necessary to let-bind two variables 
> around calls for non-*Help* buffers, and so forth.

I think the best solution is to change the default value of
help-link-key-to-documentation to be nil, and then bind it to non-nil
in Help commands.

I'm not sure I understand what additional feature you have in mind and
how such an additional feature could be related to this discussion.
So please elaborate on that part.