(let ((ch (read-event)))
(if (eq ch ?\s)
(set-window-configuration conf)
- (setq unread-command-events (list ch)))))))
+ (push ch unread-command-events))))))
(defun comint-regexp-arg (prompt)
(set-window-configuration comint-dynamic-list-completions-config))
(if (eq first ?\s)
(set-window-configuration comint-dynamic-list-completions-config)
- (setq unread-command-events (listify-key-sequence key)))))))
+ (setq unread-command-events
+ (nconc (listify-key-sequence key) unread-command-events)))))))
\f
(defun comint-get-next-from-history ()
"After fetching a line from input history, this fetches the following line.
(append (make-list (1- (length (nth 1 entry)))
127)
(nth 2 entry)
- '(magic-end)))
+ '(magic-end)
+ unread-command-events))
(vector 127))
- (setq unread-command-events (list new))
+ (push new unread-command-events)
[ignore])))
((eq key 'magic-end)
;; End of double event. Ignore.
(let ((exp (nth 1 (assoc key double-map))))
(setq double-last-event key)
(setq unread-command-events
- (append (substring exp 1) '(magic-start)))
+ (append (substring exp 1) '(magic-start)
+ unread-command-events))
(vector (aref exp 0)))))))
;;; Mode
(setq select
(catch 'electric-buffer-menu-select
(message "<<< Type SPC or RET to bury the buffer list >>>")
- (setq unread-command-events (list (read-event)))
+ (push (read-event) unread-command-events)
(let ((start-point (point))
(first (progn (goto-char (point-min))
(unless Buffer-menu-use-header-line
(defun Electric-buffer-menu-exit ()
(interactive)
- (setq unread-command-events (listify-key-sequence (this-command-keys)))
+ (setq unread-command-events
+ (nconc (listify-key-sequence (this-command-keys))
+ unread-command-events))
;; for robustness
(condition-case ()
(throw 'electric-buffer-menu-select nil)
(catch 'exit
(if (pos-visible-in-window-p (point-max))
(progn (message "%s" (substitute-command-keys "<<< Press Space to bury the help buffer, Press \\[electric-help-retain] to retain it >>>"))
- (if (equal (setq unread-command-events (list (read-event)))
- '(?\s))
- (progn (setq unread-command-events nil)
- (throw 'exit t)))))
+ (let ((ev (read-event)))
+ (if (equal ev ?\s)
+ (throw 'exit t)
+ (push ev unread-command-events)))))
(let (up down both neither
(standard (and (eq (key-binding " " nil t)
'scroll-up)
(let ((ch (read-event)))
(if (eq ch ?\ )
(set-window-configuration conf)
- (setq unread-command-events (list ch))))))))
+ (push ch unread-command-events)))))))
(defun eshell-hist-word-reference (ref)
"Return the word designator index referred to by REF."
(with-current-buffer gnus-article-current-summary
(setq unread-command-events
(if (featurep 'xemacs)
- (append key nil)
- (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
- (list 'meta (- x 128))
- x))
- key)))
+ (append key unread-command-events)
+ (nconc
+ (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+ (list 'meta (- x 128))
+ x))
+ key)
+ unread-command-events)))
(let ((cursor-in-echo-area t)
gnus-pick-mode)
(describe-key (read-key-sequence nil t))))
(with-current-buffer gnus-article-current-summary
(setq unread-command-events
(if (featurep 'xemacs)
- (append key nil)
- (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
- (list 'meta (- x 128))
- x))
- key)))
+ (append key unread-command-events)
+ (nconc
+ (mapcar (lambda (x) (if (and (integerp x) (>= x 128))
+ (list 'meta (- x 128))
+ x))
+ key)
+ unread-command-events)))
(let ((cursor-in-echo-area t)
gnus-pick-mode)
(describe-key-briefly (read-key-sequence nil t) insert)))
(message (if flag "Type Space to see more"
"Type Space to return to Info"))
(if (not (eq ?\s (setq ch (read-event))))
- (progn (setq unread-command-events (list ch)) nil)
+ (progn (push ch unread-command-events) nil)
flag))
(scroll-up)))
(bury-buffer "*Help*")))
;; KEYSEQ is not defined in the translation keymap.
;; Let's return the event(s) to the caller.
(setq unread-command-events
- (string-to-list (this-single-command-raw-keys)))
+ (append (this-single-command-raw-keys)
+ unread-command-events))
(setq quail-translating nil))))
(quail-delete-region)
quail-current-str)
;; KEYSEQ is not defined in the conversion keymap.
;; Let's return the event(s) to the caller.
(setq unread-command-events
- (string-to-list (this-single-command-raw-keys)))
+ (append (this-single-command-raw-keys)
+ unread-command-events))
(setq quail-converting nil))))
(setq quail-translating nil)
(if (overlay-start quail-conv-overlay)
(list key)
(delete-region start (point))
(if key
- (setq unread-command-events (list key)))
+ (push key unread-command-events))
(if (stringp output)
(string-to-list output)
(list output))))))
(setq last-input-event nil)))
(when last-input-event
(clear-this-command-keys t)
- (setq unread-command-events (list last-input-event))))
+ (push last-input-event unread-command-events)))
(defun kmacro-get-repeat-prefix ()
(cmd (lookup-key hanja-keymap seq)))
(if (functionp cmd)
(funcall cmd)
- (setq unread-command-events (listify-key-sequence seq))
+ (setq unread-command-events
+ (nconc (listify-key-sequence seq)
+ unread-command-events))
(throw 'exit-input-loop nil))))))
(setq hanja-conversions nil))))
((commandp cmd)
(call-interactively cmd))
(t
- (setq unread-command-events (listify-key-sequence seq))
+ (setq unread-command-events
+ (nconc (listify-key-sequence seq)
+ unread-command-events))
(throw 'exit-input-loop nil))))))
(quail-delete-overlays)))))
((commandp cmd)
(call-interactively cmd))
(t
- (setq unread-command-events (listify-key-sequence seq))
+ (setq unread-command-events
+ (nconc (listify-key-sequence seq)
+ unread-command-events))
(throw 'exit-input-loop nil))))))
(quail-delete-overlays)))))
((commandp cmd)
(call-interactively cmd))
(t
- (setq unread-command-events (listify-key-sequence seq))
+ (setq unread-command-events
+ (nconc (listify-key-sequence seq)
+ unread-command-events))
(throw 'exit-input-loop nil))))))
(quail-delete-overlays)))))
(setq quail-current-str (aref quail-current-key 0))))
(if (integerp control-flag)
(setq unread-command-events
- (string-to-list
- (substring quail-current-key control-flag)))))))
+ (append
+ (substring quail-current-key control-flag)
+ unread-command-events))))))
control-flag)
;; Convert Hiragana <-> Katakana in the current translation region.
(defun quail-japanese-self-insert-and-switch-to-alpha (key idx)
(quail-delete-region)
- (setq unread-command-events (list (aref key (1- idx))))
+ (push (aref key (1- idx)) unread-command-events)
(quail-japanese-switch-package "q" 1))
(defvar quail-japanese-switch-table
(buffer-substring (overlay-start quail-overlay)
(overlay-end quail-overlay))
unread-command-events
- (string-to-list
- (substring quail-current-key control-flag)))
+ (append
+ (substring quail-current-key control-flag)
+ unread-command-events))
(setq quail-current-str
(compose-string (quail-lookup-map-and-concat quail-current-key))))
control-flag)
(buffer-substring (overlay-start quail-overlay)
(overlay-end quail-overlay))
unread-command-events
- (string-to-list
- (substring quail-current-key control-flag)))
+ (append
+ (substring quail-current-key control-flag)
+ unread-command-events))
(let ((lao-str (lao-transcribe-roman-to-lao-string quail-current-key)))
(if (> (aref lao-str 0) 255)
(setq quail-current-str lao-str)
(buffer-substring (overlay-start quail-overlay)
(overlay-end quail-overlay))
unread-command-events
- (string-to-list
- (substring quail-current-key control-flag)))
+ (append
+ (substring quail-current-key control-flag)
+ unread-command-events))
;; Special treatment of "-d..." and "-y...".
(if (string-match "^-[dy]" quail-current-key)
(setq quail-current-key (substring quail-current-key 1)))
(buffer-substring (overlay-start quail-overlay)
(overlay-end quail-overlay))
unread-command-events
- (string-to-list
- (substring quail-current-key control-flag)))
+ (append
+ (substring quail-current-key control-flag)
+ unread-command-events))
(let ((transcription (quail-tibkey-to-transcription quail-current-key)))
(if (> (length transcription) 0)
(let ((quail-current-key transcription))
;; not used.
(defun te-escape-extended-command-unread ()
(interactive)
- (setq unread-command-events (listify-key-sequence (this-command-keys)))
+ (setq unread-command-events
+ (nconc (listify-key-sequence (this-command-keys))
+ unread-command-events))
(te-escape-extended-command))
(defun te-set-escape-char (c)
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.
(scroll-up))))
(message ""))
(t
- (setq unread-command-events (list event))
+ (push event unread-command-events)
(throw 'done nil)))))
(if (and pcomplete-last-window-config
pcomplete-restore-window-delay)
cperl-can-font-lock)
(defun cperl-putback-char (c) ; Emacs 19
- (set 'unread-command-events (list c))) ; Avoid undefined warning
+ (push c unread-command-events)) ; Avoid undefined warning
(if (featurep 'xemacs)
(defun cperl-putback-char (c) ; XEmacs >= 19.12
- (setq unread-command-events (list (eval '(character-to-event c))))))
+ (push (eval '(character-to-event c)) unread-command-events)))
(or (fboundp 'uncomment-region)
(defun uncomment-region (beg end)
(1+ (point)))))))))
(unless non-empty
(error "No tree buffers"))
- (setf unread-command-events (listify-key-sequence "p"))
+ (setf unread-command-events
+ (nconc (listify-key-sequence "p") unread-command-events))
(shrink-window-if-larger-than-buffer (selected-window))
(setq buffer-read-only t))))
(message "Type SPC to continue editing.")
(let ((char (read-event)))
(or (equal char ?\s)
- (setq unread-command-events (list char))))))
+ (push char unread-command-events)))))
(fortran-window-create)))
(defun fortran-split-line ()
(let ((ch (read-event)))
(if (eq ch ?\ )
(set-window-configuration conf)
- (setq unread-command-events (list ch)))))))
+ (push ch unread-command-events))))))
(defun inferior-octave-output-digest (_proc string)
"Special output filter for the inferior Octave process.
(let ((next-input (read-char)))
(if (= next-input ?-) ; four dashes
(vhdl-comment-display t)
- (setq unread-command-events ; pushback the char
- (list (vhdl-character-to-event next-input))))))
- (setq unread-command-events ; pushback the char
- (list (vhdl-character-to-event next-input)))
+ (push (vhdl-character-to-event next-input)
+ ; pushback the char
+ unread-command-events))))
+ (push (vhdl-character-to-event next-input) ; pushback the char
+ unread-command-events)
(vhdl-comment-insert)))))
(self-insert-command count)))
(setq code t))
(unless code
(insert "--")) ; hardwire to 1 space or use vhdl-basic-offset?
- (setq unread-command-events
- (list (vhdl-character-to-event next-input)))))) ; pushback the char
+ (push (vhdl-character-to-event next-input) ; pushback the char
+ unread-command-events))))
(defun vhdl-comment-display (&optional line-exists)
"Add 2 comment lines at the current indent, making a display comment."
;; delete CR which is still in event queue
(if (fboundp 'enqueue-eval-event)
(enqueue-eval-event 'delete-char -1)
- (setq unread-command-events ; push back a delete char
- (list (vhdl-character-to-event ?\177))))))))
+ (push (vhdl-character-to-event ?\177) ; push back a delete char
+ unread-command-events))))))
(defun vhdl-template-alias-hook ()
(vhdl-hooked-abbrev 'vhdl-template-alias))
(cond ((null translated))
((not (integerp translated))
(setq unread-command-events
- (listify-key-sequence (this-single-command-raw-keys))
+ (nconc (listify-key-sequence (this-single-command-raw-keys))
+ unread-command-events)
done t))
((/= (logand translated ?\M-\^@) 0)
;; Turn a meta-character into a character with the 0200 bit set.
(setq done t))
((not first)
(setq unread-command-events
- (listify-key-sequence (this-single-command-raw-keys))
+ (nconc (listify-key-sequence (this-single-command-raw-keys))
+ unread-command-events)
done t))
(t (setq code translated
done t)))
(or (eq event exit-char)
(eq event (event-convert-list exit-char))
(setq unread-command-events
- (append (this-single-command-raw-keys))))))
+ (append (this-single-command-raw-keys)
+ unread-command-events)))))
(delete-overlay ol))))
\f
(let ((ch (read-event)))
(if (eq ch ?\s)
(set-window-configuration conf)
- (setq unread-command-events (list ch)))))))
+ (push ch unread-command-events))))))
(defun term-regexp-arg (prompt)
(set-window-configuration conf))
(if (eq first ?\s)
(set-window-configuration conf)
- (setq unread-command-events (listify-key-sequence key)))))))
+ (setq unread-command-events
+ (nconc (listify-key-sequence key)
+ unread-command-events)))))))
;; I need a make-term that doesn't surround with *s -mm
(defun term-ansi-make-term (name program &optional startfile &rest switches)
(let* ((echo-keystrokes 0)
(c (read-event)))
(if (not (eq c 32))
- (setq unread-command-events (list c)))))
+ (push c unread-command-events))))
(erase-buffer)))))
;; Improved auto-save file names.