diff options
author | Glenn Morris <rgm@gnu.org> | 2013-06-14 14:37:38 -0400 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-06-14 14:37:38 -0400 |
commit | 230dcbaf2ff0615d72c5d2ca41edb999b6bc1b87 (patch) | |
tree | 3dd4e46df2ba3cf3e5f8be446820fd04dbf753a4 /lisp/term | |
parent | 4452891d08f49fb86098cf06636af8d4ce69ce2a (diff) | |
download | emacs-230dcbaf2ff0615d72c5d2ca41edb999b6bc1b87.tar.gz |
* term/xterm.el (xterm--query): Stop after first matching handler. (Bug#14615)
Diffstat (limited to 'lisp/term')
-rw-r--r-- | lisp/term/xterm.el | 6 |
1 files changed, 5 insertions, 1 deletions
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: (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))))))) |