From 595dcf88fd880a1c96fb7bb462ac53fedd2eb744 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 18 Oct 2021 07:37:08 +0200 Subject: [PATCH] Do kbd-valid-p prefix comparisons case-sensitively * lisp/subr.el (kbd-valid-p): Compare case-sensitively. --- lisp/subr.el | 3 ++- test/lisp/subr-tests.el | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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")))) -- 2.39.2