Commit 8d6fd8d4 authored by John Paul Wallington's avatar John Paul Wallington
Browse files

(with-case-table): Use `make-symbol' to avoid variable capture.

Restore the table in the same buffer.
parent 510def3e
......@@ -2485,11 +2485,15 @@ in BODY."
"Execute the forms in BODY with TABLE as the current case table.
The value returned is the value of the last form in BODY."
(declare (indent 1) (debug t))
`(let ((old-case-table (current-case-table)))
(unwind-protect
(progn (set-case-table ,table)
,@body)
(set-case-table old-case-table))))
(let ((old-case-table (make-symbol "table"))
(old-buffer (make-symbol "buffer")))
`(let ((,old-case-table (current-case-table))
(,old-buffer (current-buffer)))
(unwind-protect
(progn (set-case-table ,table)
,@body)
(with-current-buffer ,old-buffer
(set-case-table ,old-case-table))))))
;;;; Constructing completion tables.
......
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