APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1527252646 -3600
# Fri May 25 13:50:46 2018 +0100
# Node ID edcd19fab0c4981fbb73c42048f90df3fdfbdc09
# Parent 65f388195140fc4a544c42a52b93e30ec9df46ca
Give definitions for #'{key-or-mouse,timeout-or-eval,char-or}-event-p.
lisp/ChangeLog addition:
2018-05-25 Aidan Kehoe <kehoea(a)parhasard.net>
* events.el:
* events.el (key-or-mouse-event-p): New.
* events.el (timeout-or-eval-event-p): New.
* events.el (char-or-event-p): New.
Make these available, the C code has been calling them from
wrong_type_argument() for years, despite their not existing.
diff -r 65f388195140 -r edcd19fab0c4 lisp/ChangeLog
--- a/lisp/ChangeLog Sat May 19 11:21:44 2018 +0100
+++ b/lisp/ChangeLog Fri May 25 13:50:46 2018 +0100
@@ -1,3 +1,12 @@
+2018-05-25 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * events.el:
+ * events.el (key-or-mouse-event-p): New.
+ * events.el (timeout-or-eval-event-p): New.
+ * events.el (char-or-event-p): New.
+ Make these available, the C code has been calling them from
+ wrong_type_argument() for years, despite their not existing.
+
2018-04-27 Aidan Kehoe <kehoea(a)parhasard.net>
* bytecomp.el:
diff -r 65f388195140 -r edcd19fab0c4 lisp/events.el
--- a/lisp/events.el Sat May 19 11:21:44 2018 +0100
+++ b/lisp/events.el Fri May 25 13:50:46 2018 +0100
@@ -102,6 +102,21 @@
normally this means a menu selection or scrollbar action."
(and (event-live-p object) (eq 'misc-user (event-type object))))
+(defun key-or-mouse-event-p (object)
+ "Return t if OBJECT is a key press, a mouse event, or a misc-user event."
+ (and (event-live-p object)
+ (member* (event-type object) '(key-press button-press button-release
+ motion misc-user)) t))
+
+(defun timeout-or-eval-event-p (object)
+ "Return t if OBJECT is a timeout, a misc-user, or an eval event."
+ (and (event-live-p object)
+ (member* (event-type object) '(timeout misc-user eval)) t))
+
+(defun char-or-event-p (object)
+ "Return t if OBJECT is an event, a character, or a `char-int'."
+ (or (eventp object) (char-or-char-int-p object)))
+
;; You could just as easily use event-glyph but we include this for
;; consistency.
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)
Show replies by date