summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-06-18 16:01:45 +0200
committerStefan Kangas <stefan@marxist.se>2022-06-18 19:56:07 +0200
commit4f3c1eb4c5c1404c2f2726e36a4803f4fd6257b1 (patch)
treea15561644e67b859dfa4b152b0bd6a9f10a2ae2a /lisp/help.el
parente8bb4aba71b651f5b661ad9c3ed798e95c6fd212 (diff)
downloademacs-4f3c1eb4c5c1404c2f2726e36a4803f4fd6257b1.tar.gz
Respect no-face argument in literal key substitutions
* lisp/help.el (substitute-command-keys): Respect 'no-face' argument also in literal key substitutions. * test/lisp/help-tests.el (help-tests-substitute-key-bindings/help-key-binding-face): Rename from help-tests-substitute-key-bindings/face-help-key-binding. (help-tests-substitute-key-bindings/help-key-binding-no-face): New test.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 766bae0845c..2d02b22e526 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1176,9 +1176,10 @@ Otherwise, return a new string."
((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
- font-lock-face help-key-binding)))
+ (unless no-face
+ (add-text-properties orig-point (point)
+ '( face help-key-binding
+ font-lock-face help-key-binding))))
;; 1C. \[foo] is replaced with the keybinding.
((and (= (following-char) ?\[)
(save-excursion