changeset 2063:2f0555b428c4

(event-basic-type): New function.
author Richard M. Stallman <rms@gnu.org>
date Mon, 08 Mar 1993 00:07:53 +0000
parents 79a2651d9de3
children 092ea2e7316e
files lisp/subr.el
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sun Mar 07 23:45:23 1993 +0000
+++ b/lisp/subr.el	Mon Mar 08 00:07:53 1993 +0000
@@ -244,6 +244,14 @@
 	    (setq list (cons 'alt list)))
 	list))))
 
+(defun event-basic-type (event)
+  "Returns the basic type of the given event (all modifiers removed).
+The value is an ASCII printing character (not upper case) or a symbol."
+  (if (symbolp event)
+      (car (get event 'event-symbol-elements))
+    (let ((base (logand event (1- (lsh 1 18)))))
+      (downcase (if (< base 32) (logior base 64) base)))))
+
 (defmacro save-match-data (&rest body)
   "Execute the BODY forms, restoring the global value of the match data."
   (let ((original (make-symbol "match-data")))