emacs-diffs
[Top][All Lists]
Advanced

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

master f188b0185e: Allow saying \\=`M-x ...' in a doc string


From: Lars Ingebrigtsen
Subject: master f188b0185e: Allow saying \\=`M-x ...' in a doc string
Date: Mon, 13 Jun 2022 11:03:11 -0400 (EDT)

branch: master
commit f188b0185e7ace193b1c5501c5520578b4216ea0
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Allow saying \\=`M-x ...' in a doc string
    
    * lisp/help.el (substitute-command-keys): Allow saying \\=`M-x
    foo' in doc strings (and have it be fontified as a key binding).
---
 lisp/help.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/help.el b/lisp/help.el
index 9928b28fb6..766bae0845 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1173,7 +1173,8 @@ Otherwise, return a new string."
                 (let ((k (buffer-substring-no-properties orig-point (point))))
                   (cond ((= (length k) 0)
                          (error "Empty key sequence in substitution"))
-                        ((not (key-valid-p k))
+                        ((and (not (string-match-p "\\`M-x " k))
+                              (not (key-valid-p k)))
                          (error "Invalid key sequence in substitution: `%s'" 
k))))
                 (add-text-properties orig-point (point)
                                      '( face help-key-binding



reply via email to

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