comparison lisp/emacs-lisp/tq.el @ 20693:b48b8060e70d

(tq-filter): Use with-current-buffer.
author Richard M. Stallman <rms@gnu.org>
date Wed, 21 Jan 1998 05:26:11 +0000
parents ef3033d89075
children d9207f337e2d
comparison
equal deleted inserted replaced
20692:8af33d2de7b2 20693:b48b8060e70d
85 (delete-process (tq-process tq)) 85 (delete-process (tq-process tq))
86 (kill-buffer (tq-buffer tq))) 86 (kill-buffer (tq-buffer tq)))
87 87
88 (defun tq-filter (tq string) 88 (defun tq-filter (tq string)
89 "Append STRING to the TQ's buffer; then process the new data." 89 "Append STRING to the TQ's buffer; then process the new data."
90 (let ((old-buffer (current-buffer))) 90 (with-current-buffer (tq-buffer tq)
91 (unwind-protect 91 (goto-char (point-max))
92 (progn 92 (insert string)
93 (set-buffer (tq-buffer tq)) 93 (tq-process-buffer tq)))
94 (goto-char (point-max))
95 (insert string)
96 (tq-process-buffer tq))
97 (set-buffer old-buffer))))
98 94
99 (defun tq-process-buffer (tq) 95 (defun tq-process-buffer (tq)
100 "Check TQ's buffer for the regexp at the head of the queue." 96 "Check TQ's buffer for the regexp at the head of the queue."
101 (set-buffer (tq-buffer tq)) 97 (set-buffer (tq-buffer tq))
102 (if (= 0 (buffer-size)) () 98 (if (= 0 (buffer-size)) ()