aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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")))