From f8169b5e8f3864b6e620cc7f9ca776110750f554 Mon Sep 17 00:00:00 2001 From: Michael Kifer Date: Fri, 16 Feb 1996 19:01:53 +0000 Subject: [PATCH] (vip-event-key): ignore consp events. --- lisp/emulation/viper-util.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index e1e87102bfc..f486b661796 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -776,7 +776,7 @@ that Viper doesn't know about.") ;; Emacs has a bug in eventp, which causes (eventp nil) to return (nil) -;; instead of nil, if '(nil) was previously inadvertantly assigned to +;; instead of nil, if '(nil) was previously inadvertently assigned to ;; unread-command-events (defun vip-event-key (event) (or (and event (eventp event)) @@ -801,10 +801,17 @@ that Viper doesn't know about.") event event)) ;; Emacs has the oddity whereby characters 128+char ;; represent M-char *if* this appears inside a string. - ;; So, we convert them manually into (mata char). + ;; So, we convert them manually to (meta char). ((and (numberp event) (< ?\C-? event) (<= event 255)) (setq mod '(meta) event (- event ?\C-? 1))) + ;; If EVENT is a list, e.g., (switch-frame frame), we + ;; ignore it, since we can't save this kind of events in a + ;; textual form. In most cases, such events are created + ;; unintentionally, and ignoring them is the right thing. + ;; If an event of this kind was created intentionally during + ;; macro definition---too bad. + ((consp event) nil) (t (event-basic-type event))) ))) -- 2.11.4.GIT