]> git.eshelyaron.com Git - emacs.git/commitdiff
* term/xterm.el (xterm--query): Stop after first matching handler. (Bug#14615)
authorGlenn Morris <rgm@gnu.org>
Fri, 14 Jun 2013 18:37:38 +0000 (14:37 -0400)
committerGlenn Morris <rgm@gnu.org>
Fri, 14 Jun 2013 18:37:38 +0000 (14:37 -0400)
lisp/ChangeLog
lisp/term/xterm.el

index 6e38e3119f121e3c1b1c12544b17d74330b73491..2605247244a296c853f7fa12a02c39bf7d65eddd 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-14  Glenn Morris  <rgm@gnu.org>
+
+       * term/xterm.el (xterm--query):
+       Stop after first matching handler.  (Bug#14615)
+
 2013-06-14 Ivan Kanis <ivan@kanis.fr>
 
        Add support for dired in saveplace.
index 05a129225eeaee8fafeb464dd04fa7ee18e45a5e..86f4583b987dd15b80be4a99e9d0396b47a581b1 100644 (file)
@@ -516,6 +516,9 @@ The relevant features are:
           (terminal-init-xterm-modify-other-keys))))))
 
 (defun xterm--query (query handlers)
+  "Send QUERY string to the terminal and watch for a response.
+HANDLERS is an alist with elements of the form (STRING . FUNCTION).
+We run the first FUNCTION whose STRING matches the input events."
   ;; We used to query synchronously, but the need to use `discard-input' is
   ;; rather annoying (bug#6758).  Maybe we could always use the asynchronous
   ;; approach, but it's less tested.
@@ -544,7 +547,8 @@ The relevant features are:
                                  nil))))
           (setq i (1+ i)))
         (if (= i (length (car handler)))
-            (funcall (cdr handler))
+            (progn (setq handlers nil)
+                   (funcall (cdr handler)))
           (while (> i 0)
             (push (aref (car handler) (setq i (1- i)))
                   unread-command-events)))))))