From: Richard M. Stallman Date: Sun, 15 Sep 1996 18:38:49 +0000 (+0000) Subject: (tq-filter): Add unwind-protect and save-match-data. X-Git-Tag: emacs-20.1~3741 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=14603e08e2297dfab3c32f8181b346982d291ba6;p=emacs.git (tq-filter): Add unwind-protect and save-match-data. --- 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."