]> git.eshelyaron.com Git - emacs.git/commitdiff
Add face to mouse buttons in command substitutions
authorStefan Kangas <stefan@marxist.se>
Wed, 3 Aug 2022 14:08:17 +0000 (16:08 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 3 Aug 2022 14:18:00 +0000 (16:18 +0200)
* 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
test/lisp/help-tests.el

index 1c1ce1618ca464a08b5835b2a108608f15448a68..f58d252bae2ce4856ae65a20a49de52732ea1d1b 100644 (file)
@@ -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)
index 5c935965f786b5c3b56d1cb9c25cad7290139e9f..7f30b27b00daad0a31a152890b8027c8a6e01d6a 100644 (file)
@@ -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."