From 5572c97f45698f0ce683444ddbdde8ac98a977a0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 20 Apr 2004 20:56:32 +0000 Subject: [PATCH] (event-modifiers): Fix the criterion for ASCII control chars. --- lisp/subr.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 81f774bdc68..57f725fb44c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -644,14 +644,16 @@ and `down'." (setq type (car type))) (if (symbolp type) (cdr (get type 'event-symbol-elements)) - (let ((list nil)) - (or (zerop (logand type ?\M-\^@)) + (let ((list nil) + (char (logand type (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@ + ?\H-\^@ ?\s-\^@ ?\A-\^@))))) + (if (not (zerop (logand type ?\M-\^@))) (setq list (cons 'meta list))) - (or (and (zerop (logand type ?\C-\^@)) - (>= (logand type 127) 32)) + (if (or (not (zerop (logand type ?\C-\^@))) + (< char 32)) (setq list (cons 'control list))) - (or (and (zerop (logand type ?\S-\^@)) - (= (logand type 255) (downcase (logand type 255)))) + (if (or (not (zerop (logand type ?\S-\^@))) + (/= char (downcase char))) (setq list (cons 'shift list))) (or (zerop (logand type ?\H-\^@)) (setq list (cons 'hyper list))) -- 2.39.5