From: Lars Ingebrigtsen Date: Mon, 18 Oct 2021 05:37:08 +0000 (+0200) Subject: Do kbd-valid-p prefix comparisons case-sensitively X-Git-Tag: emacs-29.0.90~3671^2~517 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=595dcf88fd880a1c96fb7bb462ac53fedd2eb744;p=emacs.git Do kbd-valid-p prefix comparisons case-sensitively * lisp/subr.el (kbd-valid-p): Compare case-sensitively. --- diff --git a/lisp/subr.el b/lisp/subr.el index f2cbe363403..78709b7fa9c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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. diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 3e6a7a8bd88..238c9be1ab0 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -311,6 +311,7 @@ (should (kbd-valid-p "")) (should (kbd-valid-p "")) + (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"))))