;;; vip.el --- a VI Package for GNU Emacs
-;; Copyright (C) 1986-1988, 1992-1993, 1998, 2001-2014
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1986-1988, 1992-1993, 1998, 2001-2016 Free Software
+;; Foundation, Inc.
;; Author: Masahiko Sato <ms@sail.stanford.edu>
;; Keywords: emulations
EVENTS is a list of events, which become the beginning of the command."
(interactive "P")
(let (com key (old-map (current-local-map)))
- (if events (setq unread-command-events events))
+ (if events (setq unread-command-events
+ (append events unread-command-events)))
(setq prefix-arg arg)
(use-local-map vip-emacs-local-map)
(unwind-protect
(while (= char ?U)
(vip-describe-arg prefix-arg)
(setq char (read-char)))
- (setq unread-command-events (list char)))
+ (push char unread-command-events))
(defun vip-prefix-arg-com (char value com)
"Vi operator as prefix argument."
(while (= char ?U)
(vip-describe-arg prefix-arg)
(setq char (read-char)))
- (setq unread-command-events (list char)))
+ (push char unread-command-events))
;; as com is non-nil, this means that we have a command to execute
(if (or (= (car com) ?r) (= (car com) ?R))
;; execute appropriate region command.