Commit 14603e08 authored by Richard M. Stallman's avatar Richard M. Stallman

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

parent 36cef1b7
......@@ -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."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment