# HG changeset patch # User Richard M. Stallman # Date 731549273 0 # Node ID 2f0555b428c48b02f54313e45d4c3da5f82b47cd # Parent 79a2651d9de35c8b10847d99ae30572282003016 (event-basic-type): New function. diff -r 79a2651d9de3 -r 2f0555b428c4 lisp/subr.el --- 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")))