diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-09-15 18:38:49 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-09-15 18:38:49 +0000 |
commit | 14603e08e2297dfab3c32f8181b346982d291ba6 (patch) | |
tree | 298294246090fb987c507b035511792b7d31be59 /lisp/emacs-lisp | |
parent | 36cef1b75947f6e8cc1572a735614c5ff0d61150 (diff) | |
download | emacs-14603e08e2297dfab3c32f8181b346982d291ba6.tar.gz emacs-14603e08e2297dfab3c32f8181b346982d291ba6.tar.bz2 emacs-14603e08e2297dfab3c32f8181b346982d291ba6.zip |
(tq-filter): Add unwind-protect and save-match-data.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/tq.el | 12 |
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." (defun tq-filter (tq string) "Append STRING to the TQ's buffer; then process the new data." - (set-buffer (tq-buffer tq)) - (goto-char (point-max)) - (insert string) - (tq-process-buffer tq)) + (let ((old-buffer (current-buffer))) + (unwind-protect + (save-match-data + (set-buffer (tq-buffer tq)) + (goto-char (point-max)) + (insert string) + (tq-process-buffer tq)) + (set-buffer old-buffer)))) (defun tq-process-buffer (tq) "Check TQ's buffer for the regexp at the head of the queue." |