emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/tq.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/tq.el,v
Date: Sun, 27 Aug 2006 10:42:44 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     06/08/27 10:42:40

Index: lisp/emacs-lisp/tq.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/emacs-lisp/tq.el,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- lisp/emacs-lisp/tq.el       16 Apr 2006 02:17:00 -0000      1.22
+++ lisp/emacs-lisp/tq.el       27 Aug 2006 10:42:40 -0000      1.23
@@ -66,7 +66,7 @@
 ;; regexp: regular expression that matches the end of a response from
 ;; the process
 (defun tq-queue-head-regexp   (tq) (car (cdr (car (tq-queue tq)))))
-;; closure: additional data to pass to function
+;; closure: additional data to pass to the function
 (defun tq-queue-head-closure  (tq) (car (cdr (cdr (car (tq-queue tq))))))
 ;; fn: function to call upon receiving a complete response from the
 ;; process
@@ -119,7 +119,7 @@
 the process has finished replying to any previous questions.
 This produces more reliable results with some processes."
   (let ((sendp (or (not delay-question)
-                  (not (tq-queue-head-question tq)))))
+                  (not (tq-queue tq)))))
     (tq-queue-add tq (unless sendp question) regexp closure fn)
     (when sendp
       (process-send-string (tq-process tq) question))))
@@ -131,14 +131,18 @@
 
 (defun tq-filter (tq string)
   "Append STRING to the TQ's buffer; then process the new data."
-  (with-current-buffer (tq-buffer tq)
+  (let ((buffer (tq-buffer tq)))
+    (when (buffer-live-p buffer)
+      (with-current-buffer buffer
     (goto-char (point-max))
     (insert string)
-    (tq-process-buffer tq)))
+       (tq-process-buffer tq)))))
 
 (defun tq-process-buffer (tq)
   "Check TQ's buffer for the regexp at the head of the queue."
-  (set-buffer (tq-buffer tq))
+  (let ((buffer (tq-buffer tq)))
+    (when (buffer-live-p buffer)
+      (set-buffer buffer)
   (if (= 0 (buffer-size)) ()
     (if (tq-queue-empty tq)
        (let ((buf (generate-new-buffer "*spurious*")))
@@ -159,7 +163,7 @@
                             answer)
                  (error nil))
              (tq-queue-pop tq))
-           (tq-process-buffer tq))))))
+               (tq-process-buffer tq))))))))
 
 (provide 'tq)
 




reply via email to

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