emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r112990: * term/xterm.el (xterm--query): Stop after


From: Glenn Morris
Subject: [Emacs-diffs] trunk r112990: * term/xterm.el (xterm--query): Stop after first matching handler. (Bug#14615)
Date: Fri, 14 Jun 2013 18:37:53 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112990
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2013-06-14 14:37:38 -0400
message:
  * term/xterm.el (xterm--query): Stop after first matching handler.  
(Bug#14615)
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/term/xterm.el             xterm.el-20091113204419-o5vbwnq5f7feedwu-884
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-14 09:59:14 +0000
+++ b/lisp/ChangeLog    2013-06-14 18:37:38 +0000
@@ -1,3 +1,8 @@
+2013-06-14  Glenn Morris  <address@hidden>
+
+       * term/xterm.el (xterm--query):
+       Stop after first matching handler.  (Bug#14615)
+
 2013-06-14 Ivan Kanis <address@hidden>
 
        Add support for dired in saveplace.

=== modified file 'lisp/term/xterm.el'
--- a/lisp/term/xterm.el        2013-05-15 23:55:41 +0000
+++ b/lisp/term/xterm.el        2013-06-14 18:37:38 +0000
@@ -516,6 +516,9 @@
           (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 @@
                                  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)))))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]