1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 07:40:39 -08:00

(tq-filter): Add unwind-protect and save-match-data.

This commit is contained in:
Richard M. Stallman 1996-09-15 18:38:49 +00:00
parent 36cef1b759
commit 14603e08e2

View file

@ -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."