all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Po Lu <luangruo@yahoo.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 52053@debbugs.gnu.org
Subject: bug#52053: 29.0.50; Nonsensical button "C-x C-f" in scratch buffer
Date: Thu, 25 Nov 2021 10:23:38 +0000	[thread overview]
Message-ID: <612d659daa29af13c2e5@heytings.org> (raw)
In-Reply-To: <87czmr5gr7.fsf@yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 16 bytes --]


Patch attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=Do-not-buttonize-key-bindings-outside-of-Help-buffer.patch, Size: 1770 bytes --]

From f0e44fc134ada890473769e80770e70e64ab11a1 Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Thu, 25 Nov 2021 10:19:32 +0000
Subject: [PATCH] Do not buttonize key bindings outside of *Help* buffers

* lisp/help.el (substitute-command-keys): help-link-key-to-documentation
is supposed to have an effect only "in *Help* buffers".  Detect whether
the output will go in a *Help* buffer, and if not, do not buttonize the
key binding.  Fixes bug#52053.
---
 lisp/help.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/help.el b/lisp/help.el
index bc3d4773da..2e21060d35 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1105,7 +1105,9 @@ substitute-command-keys
     ;; itself.
     (let ((keymap overriding-local-map)
           (inhibit-modification-hooks t)
-          (orig-buf (current-buffer)))
+          (orig-buf (current-buffer))
+          (in-help (eq (car temp-buffer-window-setup-hook)
+                       'help-mode-setup)))
       (with-temp-buffer
         (insert string)
         (goto-char (point-min))
@@ -1161,7 +1163,8 @@ substitute-command-keys
                     (delete-char (- end-point (point)))
                     (let ((key (help--key-description-fontified key)))
                       (insert (if (and help-link-key-to-documentation
-                                       (functionp fun))
+                                       (functionp fun)
+                                       in-help)
                                   ;; The `fboundp' fixes bootstrap.
                                   (if (fboundp 'help-mode--add-function-link)
                                       (help-mode--add-function-link key fun)
-- 
2.33.0


  parent reply	other threads:[~2021-11-25 10:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87czmr5gr7.fsf.ref@yahoo.com>
2021-11-23 10:05 ` bug#52053: 29.0.50; Nonsensical button "C-x C-f" in scratch buffer Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24  6:17   ` Phil Sainty
2021-11-24  7:53   ` Lars Ingebrigtsen
2021-11-24  9:28     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 10:58       ` Lars Ingebrigtsen
2021-11-24 11:15         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 11:27           ` Lars Ingebrigtsen
2021-11-24 11:36             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-24 16:39               ` Lars Ingebrigtsen
2021-11-24 17:05                 ` Andreas Schwab
2021-11-25  0:45                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-25 13:34                   ` Lars Ingebrigtsen
2021-11-26  0:38                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-26 12:36                       ` Lars Ingebrigtsen
2021-11-26 12:52                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-25 10:23   ` Gregory Heytings [this message]
2021-11-25 10:59     ` Eli Zaretskii
2021-11-25 11:07       ` Gregory Heytings
2021-11-25 11:21         ` Eli Zaretskii
2021-11-25 12:47           ` Robert Pluim
2021-11-25 13:20             ` Eli Zaretskii
2021-11-25 13:36               ` Lars Ingebrigtsen
2021-11-25 13:41           ` Gregory Heytings
2021-11-25 14:16             ` Eli Zaretskii
2021-11-25 14:55               ` Gregory Heytings
2021-11-25 15:15                 ` Eli Zaretskii
2021-11-25 22:45                   ` Gregory Heytings
2021-11-26  6:26                     ` Eli Zaretskii
2021-11-26  9:24                       ` Robert Pluim
2021-11-26 11:13                         ` Eli Zaretskii
2021-11-26 11:17                           ` Robert Pluim
2021-11-27 16:06                       ` Gregory Heytings
2021-11-27 16:08                         ` Gregory Heytings
2021-11-29 13:56                           ` Lars Ingebrigtsen
2021-11-29 14:05                             ` Eli Zaretskii
2021-11-29 14:13                               ` Lars Ingebrigtsen
2021-11-29 17:59                           ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=612d659daa29af13c2e5@heytings.org \
    --to=gregory@heytings.org \
    --cc=52053@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.