[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 95856c5154 1/2: Add face to mouse buttons in command substitution
From: |
Stefan Kangas |
Subject: |
master 95856c5154 1/2: Add face to mouse buttons in command substitutions |
Date: |
Wed, 3 Aug 2022 10:19:04 -0400 (EDT) |
branch: master
commit 95856c515464cfaf90d3fa9104b55dbcce9ac586
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Add face to mouse buttons in command substitutions
* lisp/help.el (substitute-command-keys): Add help-key-binding face to
mouse buttons in literal key substitutions.
* test/lisp/help-tests.el
(help-tests-substitute-command-keys/literal-key-sequence): Expand
test for above change.
---
lisp/help.el | 1 +
test/lisp/help-tests.el | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/help.el b/lisp/help.el
index 1c1ce1618c..f58d252bae 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1182,6 +1182,7 @@ Otherwise, return a new string."
(let ((k (buffer-substring-no-properties (+ orig-point 2)
end-point)))
(when (or (key-valid-p k)
+ (string-match-p "\\`mouse-[1-9]" k)
(string-match-p "\\`M-x " k))
(goto-char orig-point)
(delete-char 2)
diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el
index 5c935965f7..7f30b27b00 100644
--- a/test/lisp/help-tests.el
+++ b/test/lisp/help-tests.el
@@ -93,7 +93,9 @@
(with-substitute-command-keys-test
(test "\\`C-m'" "C-m")
(test "\\`C-m'\\`C-j'" "C-mC-j")
- (test "foo\\`C-m'bar\\`C-j'baz" "fooC-mbarC-jbaz")))
+ (test "foo\\`C-m'bar\\`C-j'baz" "fooC-mbarC-jbaz")
+ (test "\\`M-x next-line'" "M-x next-line")
+ (test "\\`mouse-1'" "mouse-1")))
(ert-deftest
help-tests-substitute-command-keys/literal-key-sequence-ignore-invalid ()
"Ignore any invalid literal key sequence."