]> git.eshelyaron.com Git - emacs.git/commitdiff
(eventp): Be more discriminating with integers.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 May 2004 03:17:45 +0000 (03:17 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 11 May 2004 03:17:45 +0000 (03:17 +0000)
lisp/subr.el

index 866a6f6fd7c8e828b6c95d7bedf571b9273b915b..5302558d834b02cd54f715deee3e214d4c5d2c5c 100644 (file)
@@ -629,7 +629,11 @@ The normal global definition of the character C-x indirects to this keymap.")
 
 (defsubst eventp (obj)
   "True if the argument is an event object."
-  (or (integerp obj)
+  (or (and (integerp obj)
+          ;; Filter out integers too large to be events.
+          ;; M is the biggest modifier.
+          (zerop (logand obj (lognot (1- (lsh ?\M-\^@ 1)))))
+          (char-valid-p (event-basic-type obj)))
       (and (symbolp obj)
           (get obj 'event-symbol-elements))
       (and (consp obj)