]> git.eshelyaron.com Git - emacs.git/commitdiff
Do kbd-valid-p prefix comparisons case-sensitively
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 18 Oct 2021 05:37:08 +0000 (07:37 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 18 Oct 2021 05:37:08 +0000 (07:37 +0200)
* lisp/subr.el (kbd-valid-p): Compare case-sensitively.

lisp/subr.el
test/lisp/subr-tests.el

index f2cbe363403c7d17539b52161596400a8e499921..78709b7fa9cd3c601935ceb3798025ac30594011 100644 (file)
@@ -941,7 +941,8 @@ which is
        (save-match-data
          (catch 'exit
            (let ((prefixes
-                  "\\(A-\\)?\\(C-\\)?\\(H-\\)?\\(M-\\)?\\(S-\\)?\\(s-\\)?"))
+                  "\\(A-\\)?\\(C-\\)?\\(H-\\)?\\(M-\\)?\\(S-\\)?\\(s-\\)?")
+                 (case-fold-search nil))
              (dolist (key (split-string keys " "))
                ;; Every key might have these modifiers, and they should be
                ;; in this order.
index 3e6a7a8bd880ae1a476c5ffb301fe1cceed0aa3b..238c9be1ab0c3e9de2040d76ca2b64b901ba892c 100644 (file)
   (should (kbd-valid-p "<mouse-1>"))
   (should (kbd-valid-p "<Scroll_Lock>"))
 
+  (should (not (kbd-valid-p "c-x")))
   (should (not (kbd-valid-p "C-xx")))
   (should (not (kbd-valid-p "M-xx")))
   (should (not (kbd-valid-p "M-x<TAB>"))))