aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emulation/viper-macs.el15
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."
782 (mapconcat 'char-to-string macro-name-or-body "")) 782 (mapconcat 'char-to-string macro-name-or-body ""))
783 (t macro-name-or-body))) 783 (t macro-name-or-body)))
784 784
785;; convert sequence of events (that came presumably from emacs kbd macro) into
786;; Viper's macro, which is a vector of the form
787;; [ desc desc ... ]
788;; Each desc is either a symbol of (meta symb), (shift symb), etc.
789;; Here we purge events that happen to be lists. In most cases, these events
790;; got into a macro definition unintentionally; say, when the user moves mouse
791;; during a macro definition, then something like (switch-frame ...) might get
792;; in. Another reason for purging lists-events is that we can't store them in
793;; textual form (say, in .emacs) and then read them back.
785(defun vip-events-to-macro (event-seq) 794(defun vip-events-to-macro (event-seq)
786 (vconcat (delq nil (mapcar 'vip-event-key event-seq)))) 795 (vconcat (delq nil (mapcar (function (lambda (elt)
796 (if (consp elt)
797 nil
798 (vip-event-key elt))))
799 event-seq))))
787 800
788;; convert strings or arrays of characters to Viper macro form 801;; convert strings or arrays of characters to Viper macro form
789(defun vip-char-array-to-macro (array) 802(defun vip-char-array-to-macro (array)