summaryrefslogtreecommitdiff
path: root/lisp/keymap.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-01-20 10:19:23 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-20 10:19:23 +0100
commit3eb1b2a1155d044b632f760c1a5c725c2465ba03 (patch)
tree00c7a782b911907c0e302701421d3460e1d224ad /lisp/keymap.el
parent37e2304f98fac44fd146ea34c499764a95a9bb6e (diff)
downloademacs-3eb1b2a1155d044b632f760c1a5c725c2465ba03.tar.gz
emacs-3eb1b2a1155d044b632f760c1a5c725c2465ba03.tar.bz2
emacs-3eb1b2a1155d044b632f760c1a5c725c2465ba03.zip
Make key-valid-p work in Turkey
* lisp/keymap.el (key-valid-p): Inhibit case folding, otherwise (key-valid-p "I") would return nil in tr_TR environments.
Diffstat (limited to 'lisp/keymap.el')
-rw-r--r--lisp/keymap.el64
1 files changed, 32 insertions, 32 deletions
diff --git a/lisp/keymap.el b/lisp/keymap.el
index 3e9189fba45..4dbf9cf72ff 100644
--- a/lisp/keymap.el
+++ b/lisp/keymap.el
@@ -325,38 +325,38 @@ which is
Alt-Control-Hyper-Meta-Shift-super"
(declare (pure t) (side-effect-free t))
- (and
- (stringp keys)
- (string-match-p "\\`[^ ]+\\( [^ ]+\\)*\\'" keys)
- (save-match-data
- (catch 'exit
- (let ((prefixes
- "\\(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.
- (when (string-match (concat "\\`" prefixes) key)
- (setq key (substring key (match-end 0))))
- (unless (or (and (= (length key) 1)
- ;; Don't accept control characters as keys.
- (not (< (aref key 0) ?\s))
- ;; Don't accept Meta'd characters as keys.
- (or (multibyte-string-p key)
- (not (<= 127 (aref key 0) 255))))
- (and (string-match-p "\\`<[-_A-Za-z0-9]+>\\'" key)
- ;; Don't allow <M-C-down>.
- (= (progn
- (string-match
- (concat "\\`<" prefixes) key)
- (match-end 0))
- 1))
- (string-match-p
- "\\`\\(NUL\\|RET\\|TAB\\|LFD\\|ESC\\|SPC\\|DEL\\)\\'"
- key))
- ;; Invalid.
- (throw 'exit nil)))
- t)))))
+ (let ((case-fold-search nil))
+ (and
+ (stringp keys)
+ (string-match-p "\\`[^ ]+\\( [^ ]+\\)*\\'" keys)
+ (save-match-data
+ (catch 'exit
+ (let ((prefixes
+ "\\(A-\\)?\\(C-\\)?\\(H-\\)?\\(M-\\)?\\(S-\\)?\\(s-\\)?"))
+ (dolist (key (split-string keys " "))
+ ;; Every key might have these modifiers, and they should be
+ ;; in this order.
+ (when (string-match (concat "\\`" prefixes) key)
+ (setq key (substring key (match-end 0))))
+ (unless (or (and (= (length key) 1)
+ ;; Don't accept control characters as keys.
+ (not (< (aref key 0) ?\s))
+ ;; Don't accept Meta'd characters as keys.
+ (or (multibyte-string-p key)
+ (not (<= 127 (aref key 0) 255))))
+ (and (string-match-p "\\`<[-_A-Za-z0-9]+>\\'" key)
+ ;; Don't allow <M-C-down>.
+ (= (progn
+ (string-match
+ (concat "\\`<" prefixes) key)
+ (match-end 0))
+ 1))
+ (string-match-p
+ "\\`\\(NUL\\|RET\\|TAB\\|LFD\\|ESC\\|SPC\\|DEL\\)\\'"
+ key))
+ ;; Invalid.
+ (throw 'exit nil)))
+ t))))))
(defun key-translate (from to)
"Translate character FROM to TO on the current terminal.