From 1d6fc0df363db43f2c1db696fad40f068287500b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Jul 2012 02:24:04 -0400 Subject: [PATCH] * lisp/subr.el (eventp): Presume that if it looks vaguely like an event, it's an event. Fixes: debbugs:10190 --- lisp/ChangeLog | 7 ++++++- lisp/subr.el | 14 +++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f7e3cb4fc7a..072de2b6caa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-07-19 Stefan Monnier + + * subr.el (eventp): Presume that if it looks vaguely like an event, + it's an event (bug#10190). + 2012-07-19 Fabián Ezequiel Gallina Enhancements to ppss related code (thanks Stefan). @@ -5,7 +10,7 @@ (python-indent-calculate-indentation, python-indent-dedent-line) (python-indent-electric-colon, python-nav-forward-block) (python-mode-abbrev-table) - (python-info-assignment-continuation-line-p): Simplified checks + (python-info-assignment-continuation-line-p): Simplify checks for ppss context. (python-info-continuation-line-p): Cleanup. (python-info-ppss-context): Do not catch 'quote. diff --git a/lisp/subr.el b/lisp/subr.el index 19b3475a95b..0afe33c6a4c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -909,17 +909,9 @@ 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 (and (integerp obj) - ;; FIXME: Why bother? - ;; Filter out integers too large to be events. - ;; M is the biggest modifier. - (zerop (logand obj (lognot (1- (lsh ?\M-\^@ 1))))) - (characterp (event-basic-type obj))) - (and (symbolp obj) - (get obj 'event-symbol-elements)) - (and (consp obj) - (symbolp (car obj)) - (get (car obj) 'event-symbol-elements)))) + (or (integerp obj) + (and (symbolp obj) obj (not (keywordp obj))) + (and (consp obj) (symbolp (car obj))))) (defun event-modifiers (event) "Return a list of symbols representing the modifier keys in event EVENT. -- 2.39.2