changeset 55013:aba8cece2157

(event-modifiers): Fix the criterion for ASCII control chars.
author Richard M. Stallman <rms@gnu.org>
date Tue, 20 Apr 2004 20:56:32 +0000
parents 13ef2f084366
children 202b0dc516a5
files lisp/subr.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Tue Apr 20 20:54:53 2004 +0000
+++ b/lisp/subr.el	Tue Apr 20 20:56:32 2004 +0000
@@ -644,14 +644,16 @@
 	(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)))