]> git.eshelyaron.com Git - emacs.git/commitdiff
; Do not overwrite preexisting contents of unread-command-events
authorDavid Kastrup <dak@gnu.org>
Sat, 25 Jul 2015 16:54:42 +0000 (18:54 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 4 Aug 2015 12:34:15 +0000 (14:34 +0200)
28 files changed:
lisp/comint.el
lisp/double.el
lisp/ebuff-menu.el
lisp/ehelp.el
lisp/eshell/em-hist.el
lisp/gnus/gnus-art.el
lisp/info.el
lisp/international/quail.el
lisp/international/robin.el
lisp/kmacro.el
lisp/language/hanja-util.el
lisp/leim/quail/hangul.el
lisp/leim/quail/japanese.el
lisp/leim/quail/lao.el
lisp/leim/quail/lrt.el
lisp/leim/quail/tibetan.el
lisp/obsolete/terminal.el
lisp/obsolete/vip.el
lisp/pcomplete.el
lisp/progmodes/cperl-mode.el
lisp/progmodes/ebrowse.el
lisp/progmodes/fortran.el
lisp/progmodes/octave.el
lisp/progmodes/vhdl-mode.el
lisp/simple.el
lisp/subr.el
lisp/term.el
lisp/vc/emerge.el

index de2206197514cd5307fa2ed3b342e41ee430de66..7db297a142752929dc12d0163f1dbd1bb61d28ab 100644 (file)
@@ -1051,7 +1051,7 @@ See also `comint-read-input-ring'."
       (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)
@@ -3365,7 +3365,8 @@ the completions."
            (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.
index b06f59cf6a62b4a4de581a139e667271c670192d..ee511e5596350096c8e10c5eb8ca24980d871a2a 100644 (file)
@@ -122,9 +122,10 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
                         (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.
@@ -134,7 +135,8 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
           (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
index 337ea10f26d606748ee84f677ccc23f7fc0a7c2c..93418063d10edb3e80b7018bce60e0cb793ff011 100644 (file)
@@ -133,7 +133,7 @@ Run hooks in `electric-buffer-menu-mode-hook' on entry.
            (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
@@ -210,7 +210,9 @@ See the documentation of `electric-buffer-list' for details."
 
 (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)
index 66e4f5c633bf7f4d0b14f3162efc4e27f41c1185..2e15af34a81242752d7e8aeb28da2f8dc11de596 100644 (file)
@@ -204,10 +204,10 @@ BUFFER is put back into its original major mode."
   (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)
index 1cdf6d69714d6e6b429a4e4ae7f7d355f40d01ed..9f070c33db34ea3074dc9065eca0f81870733566 100644 (file)
@@ -520,7 +520,7 @@ See also `eshell-read-history'."
        (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."
index d83eaddf16535d7985b91a3c663a2fbda0bd53b9..ffe9a2114171bde7d3a3579755593d6520c32934 100644 (file)
@@ -6871,11 +6871,13 @@ KEY is a string or a vector."
       (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))))
@@ -6893,11 +6895,13 @@ KEY is a string or a vector."
       (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)))
index 48d9d1981afa7576408ae36e64f90398dc65ec73..0a2206d61bfcebe9c56ac676c5f94bf63803a474 100644 (file)
@@ -3825,7 +3825,7 @@ with a list of packages that contain all specified keywords."
                    (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*")))
index 90a540aae304b793d8149cf45b00d2011cf54180..f60af4ab9b6d6ceb134b084083c162011fe06160 100644 (file)
@@ -1415,7 +1415,8 @@ Return the input string."
              ;; 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)
@@ -1491,7 +1492,8 @@ Return the input string."
              ;; 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)
index 8254180fcc1832240e81ab1ac523659b66aa09a6..0ef90b18932d247894887877c2696916f0a7e3ef 100644 (file)
@@ -466,7 +466,7 @@ While this input method is active, the variable
          (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))))))
index 327cf455e656f5d5a07dc145f499fda58e661aab..9636a36b1e20653a5b7446594baf77a14e2bc235 100644 (file)
@@ -432,7 +432,7 @@ Optional arg EMPTY is message to print if no macros are defined."
       (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 ()
index 8b62ee707f334771e53a142ddb9e77db859a7521..c9501d2ef8fbcc07daeb677baa7fb16dbeb14e56 100644 (file)
@@ -6585,7 +6585,9 @@ The value is a hanja character that is selected interactively."
                     (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))))
 
index 12d7358841bd9a88e88a3e6609c804f0e8d68871..56a244f45740629ae7473709710f948aac6e6f2e 100644 (file)
@@ -410,7 +410,9 @@ When a Korean input method is off, convert the following hangul character."
                      ((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)))))
 
@@ -454,7 +456,9 @@ When a Korean input method is off, convert the following hangul character."
                      ((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)))))
 
@@ -499,7 +503,9 @@ When a Korean input method is off, convert the following hangul character."
                      ((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)))))
 
index fd6628b8a45907bfcf35999d8137ce342b00d72f..831725f80658a9ef5b72c62301508605eb7fc404 100644 (file)
@@ -59,8 +59,9 @@
                 (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
index 52357afd8dd21c7c8d08791f3b95372e0ec229e1..14cf9268287c27fd5b823a971afeaf013591a143 100644 (file)
@@ -36,8 +36,9 @@
            (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)
index 342b52d6ab6fcd51d0d07b9edc13c07e87835fad..ed9138d2134c5336d031c57e2f4d4676ef29ca7c 100644 (file)
@@ -41,8 +41,9 @@
            (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)
index 1313f566defde198a836ed713f572a4e79ce2739..5dacf290c101e92db95516f82f362381fec67796 100644 (file)
@@ -50,8 +50,9 @@
            (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))
index 6bab61b0f467b6643264c387d5b32e8dc6241671..f1a38d20f39ee176242e0182e0c0b0d52a4d27df 100644 (file)
@@ -291,7 +291,9 @@ Other chars following \"%s\" are interpreted as follows:\n"
 ;; 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)
index d6adbd4d42143a0cc5971bbe3f75f5ca82fef6b6..0c345e26f803649a64300ae78086b60e26f7ab25 100644 (file)
@@ -462,7 +462,8 @@ ARG is used as the prefix value for the executed command.  If
 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
@@ -518,7 +519,7 @@ obtained so far, and COM is the command part obtained so far."
   (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."
@@ -572,7 +573,7 @@ obtained so far, and COM is the command part obtained so far."
        (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.
index 7bcf2c1759e8bd4644c6fd346f7553c2c216e063..90f069531830b094553962275c507dc6cf42c1f1 100644 (file)
@@ -1112,7 +1112,7 @@ Typing SPC flushes the help buffer."
                     (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)
index 7d2f3fcb007ca7ace69289798990d791ab15bef0..826b3ee73a88f194fd16e41d541c7ddb95235923 100644 (file)
@@ -1042,11 +1042,11 @@ In regular expressions (including character classes):
   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)
index f91e4a741ccda42f8e466d1f2b958142f287f239..8d7c8aa0267a65f395b6f644fa7936c2416447dd 100644 (file)
@@ -4223,7 +4223,8 @@ NUMBER-OF-STATIC-VARIABLES:"
                                                    (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))))
 
index 65aa7454008ca0e4bde8f7713f85b013472a8ac3..83e427da7905bcdfa95b5c2cee0392bd71b017a4 100644 (file)
@@ -1117,7 +1117,7 @@ See also `fortran-window-create'."
           (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 ()
index 50f888cb9fd0efc2050f8dac009c7022ffacb615..89e0b1052232f2ac9ab66a39a1095cd6ac7f0ed5 100644 (file)
@@ -919,7 +919,7 @@ startup file, `~/.emacs-octave'."
       (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.
index 16e4e8ed53d2602ae5526fb6a1a5faa3be8fcf6d..2edacf4e69a1ec60a6d3eeed42971ea8b338fb74 100644 (file)
@@ -8734,10 +8734,11 @@ is omitted or nil."
                  (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)))
 
@@ -10755,8 +10756,8 @@ If starting after end-comment-column, start a new line."
        (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."
@@ -11310,8 +11311,8 @@ but not if inside a comment or quote."
        ;; 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))
index 1a4bcf124db18d6ca10a21969868628b847148ee..00c25db07d780bd0cfed3e0f2ac45041538730c3 100644 (file)
@@ -693,7 +693,8 @@ any other non-digit terminates the character code and is then used as input."))
       (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.
@@ -713,7 +714,8 @@ any other non-digit terminates the character code and is then used as input."))
             (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)))
index bfdc0ff4a130cfd6c18b91bdd2dcbb6c740fc075..3dd87d6561755754fe3b730a4cb943e82215913e 100644 (file)
@@ -2539,7 +2539,8 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
            (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
index 4c829864200c9115b6a69dfb327183a6f471ebbb..06a44f29058454af523b8ca3eb3b8e87f25eb474 100644 (file)
@@ -1649,7 +1649,7 @@ See also `term-read-input-ring'."
       (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)
@@ -4128,7 +4128,9 @@ Typing SPC flushes the help buffer."
            (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)
index b17d11d34a43fd2f589a32fc48c8ebd595c4a3c1..de25cbafb0d5a479aeab72175f11a6d083d2d4bf 100644 (file)
@@ -3089,7 +3089,7 @@ SPC, it is ignored; if it is anything else, it is processed as a command."
            (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.