aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-06-14 14:37:38 -0400
committerGlenn Morris2013-06-14 14:37:38 -0400
commit230dcbaf2ff0615d72c5d2ca41edb999b6bc1b87 (patch)
tree3dd4e46df2ba3cf3e5f8be446820fd04dbf753a4
parent4452891d08f49fb86098cf06636af8d4ce69ce2a (diff)
downloademacs-230dcbaf2ff0615d72c5d2ca41edb999b6bc1b87.tar.gz
emacs-230dcbaf2ff0615d72c5d2ca41edb999b6bc1b87.zip
* term/xterm.el (xterm--query): Stop after first matching handler. (Bug#14615)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/term/xterm.el6
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6e38e3119f1..2605247244a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-06-14 Glenn Morris <rgm@gnu.org>
2
3 * term/xterm.el (xterm--query):
4 Stop after first matching handler. (Bug#14615)
5
12013-06-14 Ivan Kanis <ivan@kanis.fr> 62013-06-14 Ivan Kanis <ivan@kanis.fr>
2 7
3 Add support for dired in saveplace. 8 Add support for dired in saveplace.
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 05a129225ee..86f4583b987 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -516,6 +516,9 @@ The relevant features are:
516 (terminal-init-xterm-modify-other-keys)))))) 516 (terminal-init-xterm-modify-other-keys))))))
517 517
518(defun xterm--query (query handlers) 518(defun xterm--query (query handlers)
519 "Send QUERY string to the terminal and watch for a response.
520HANDLERS is an alist with elements of the form (STRING . FUNCTION).
521We run the first FUNCTION whose STRING matches the input events."
519 ;; We used to query synchronously, but the need to use `discard-input' is 522 ;; We used to query synchronously, but the need to use `discard-input' is
520 ;; rather annoying (bug#6758). Maybe we could always use the asynchronous 523 ;; rather annoying (bug#6758). Maybe we could always use the asynchronous
521 ;; approach, but it's less tested. 524 ;; approach, but it's less tested.
@@ -544,7 +547,8 @@ The relevant features are:
544 nil)))) 547 nil))))
545 (setq i (1+ i))) 548 (setq i (1+ i)))
546 (if (= i (length (car handler))) 549 (if (= i (length (car handler)))
547 (funcall (cdr handler)) 550 (progn (setq handlers nil)
551 (funcall (cdr handler)))
548 (while (> i 0) 552 (while (> i 0)
549 (push (aref (car handler) (setq i (1- i))) 553 (push (aref (car handler) (setq i (1- i)))
550 unread-command-events))))))) 554 unread-command-events)))))))