From: Stefan Monnier Date: Tue, 11 May 2004 03:17:45 +0000 (+0000) Subject: (eventp): Be more discriminating with integers. X-Git-Tag: ttn-vms-21-2-B4~6284 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7a2937ce8a29cc4ad7cad8ca56a617c764b068bc;p=emacs.git (eventp): Be more discriminating with integers. --- diff --git a/lisp/subr.el b/lisp/subr.el index 866a6f6fd7c..5302558d834 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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)