diff options
author | Michael Kifer <kifer@cs.stonybrook.edu> | 1996-02-16 21:50:58 +0000 |
---|---|---|
committer | Michael Kifer <kifer@cs.stonybrook.edu> | 1996-02-16 21:50:58 +0000 |
commit | df93b82b6fc093ee281a407df94297e655cb3a72 (patch) | |
tree | 0c2a35cb36770f01fa96d417f7c77b458e800be0 /lisp/emulation/viper-macs.el | |
parent | 90e9c54bb039a5838c061ca09a64271874ea916b (diff) | |
download | emacs-df93b82b6fc093ee281a407df94297e655cb3a72.tar.gz |
(vip-events-to-macro): discard events represented as lists in macro
definitions.
Diffstat (limited to 'lisp/emulation/viper-macs.el')
-rw-r--r-- | lisp/emulation/viper-macs.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el index 3725804f50d..9434ca2002d 100644 --- a/lisp/emulation/viper-macs.el +++ b/lisp/emulation/viper-macs.el @@ -782,8 +782,21 @@ there." (mapconcat 'char-to-string macro-name-or-body "")) (t macro-name-or-body))) +;; convert sequence of events (that came presumably from emacs kbd macro) into +;; Viper's macro, which is a vector of the form +;; [ desc desc ... ] +;; Each desc is either a symbol of (meta symb), (shift symb), etc. +;; Here we purge events that happen to be lists. In most cases, these events +;; got into a macro definition unintentionally; say, when the user moves mouse +;; during a macro definition, then something like (switch-frame ...) might get +;; in. Another reason for purging lists-events is that we can't store them in +;; textual form (say, in .emacs) and then read them back. (defun vip-events-to-macro (event-seq) - (vconcat (delq nil (mapcar 'vip-event-key event-seq)))) + (vconcat (delq nil (mapcar (function (lambda (elt) + (if (consp elt) + nil + (vip-event-key elt)))) + event-seq)))) ;; convert strings or arrays of characters to Viper macro form (defun vip-char-array-to-macro (array) |