aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-08 00:07:53 +0000
committerRichard M. Stallman1993-03-08 00:07:53 +0000
commitd63de416be4b4732ff5307ac62c3ff3d057df4d9 (patch)
tree6cc7640bee4b7b7df129b0b7966c81ff13d846e1
parent1a7c673b85b6c77d90825c82f4b2e1f35cb5f219 (diff)
downloademacs-d63de416be4b4732ff5307ac62c3ff3d057df4d9.tar.gz
emacs-d63de416be4b4732ff5307ac62c3ff3d057df4d9.zip
(event-basic-type): New function.
-rw-r--r--lisp/subr.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 5f30e0bd96c..a8533e19b0b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -244,6 +244,14 @@ See also the function `event-modifier-bits'."
244 (setq list (cons 'alt list))) 244 (setq list (cons 'alt list)))
245 list)))) 245 list))))
246 246
247(defun event-basic-type (event)
248 "Returns the basic type of the given event (all modifiers removed).
249The value is an ASCII printing character (not upper case) or a symbol."
250 (if (symbolp event)
251 (car (get event 'event-symbol-elements))
252 (let ((base (logand event (1- (lsh 1 18)))))
253 (downcase (if (< base 32) (logior base 64) base)))))
254
247(defmacro save-match-data (&rest body) 255(defmacro save-match-data (&rest body)
248 "Execute the BODY forms, restoring the global value of the match data." 256 "Execute the BODY forms, restoring the global value of the match data."
249 (let ((original (make-symbol "match-data"))) 257 (let ((original (make-symbol "match-data")))