diff options
| author | Michael Kifer | 1996-02-16 21:50:58 +0000 |
|---|---|---|
| committer | Michael Kifer | 1996-02-16 21:50:58 +0000 |
| commit | df93b82b6fc093ee281a407df94297e655cb3a72 (patch) | |
| tree | 0c2a35cb36770f01fa96d417f7c77b458e800be0 | |
| parent | 90e9c54bb039a5838c061ca09a64271874ea916b (diff) | |
| download | emacs-df93b82b6fc093ee281a407df94297e655cb3a72.tar.gz emacs-df93b82b6fc093ee281a407df94297e655cb3a72.zip | |
(vip-events-to-macro): discard events represented as lists in macro
definitions.
| -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." | |||
| 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) |