aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-15 18:38:49 +0000
committerRichard M. Stallman1996-09-15 18:38:49 +0000
commit14603e08e2297dfab3c32f8181b346982d291ba6 (patch)
tree298294246090fb987c507b035511792b7d31be59 /lisp
parent36cef1b75947f6e8cc1572a735614c5ff0d61150 (diff)
downloademacs-14603e08e2297dfab3c32f8181b346982d291ba6.tar.gz
emacs-14603e08e2297dfab3c32f8181b346982d291ba6.zip
(tq-filter): Add unwind-protect and save-match-data.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/tq.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/tq.el b/lisp/emacs-lisp/tq.el
index 8654e76fd59..e0524bb6e19 100644
--- a/lisp/emacs-lisp/tq.el
+++ b/lisp/emacs-lisp/tq.el
@@ -87,10 +87,14 @@ that's how we tell where the answer ends."
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 (set-buffer (tq-buffer tq)) 90 (let ((old-buffer (current-buffer)))
91 (goto-char (point-max)) 91 (unwind-protect
92 (insert string) 92 (save-match-data
93 (tq-process-buffer tq)) 93 (set-buffer (tq-buffer tq))
94 (goto-char (point-max))
95 (insert string)
96 (tq-process-buffer tq))
97 (set-buffer old-buffer))))
94 98
95(defun tq-process-buffer (tq) 99(defun tq-process-buffer (tq)
96 "Check TQ's buffer for the regexp at the head of the queue." 100 "Check TQ's buffer for the regexp at the head of the queue."