# HG changeset patch # User Richard M. Stallman # Date 1082494592 0 # Node ID aba8cece21573614bd4a1dfcec488a9f6c4af1d0 # Parent 13ef2f084366c8f386801f07b95d2684af33afb3 (event-modifiers): Fix the criterion for ASCII control chars. diff -r 13ef2f084366 -r aba8cece2157 lisp/subr.el --- 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)))