aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Paul Wallington2007-04-06 12:15:04 +0000
committerJohn Paul Wallington2007-04-06 12:15:04 +0000
commit8d6fd8d48092177de4dc93c2d929d59b41d98e9e (patch)
tree71333634292e01c526607ec72c077f1c58abe99b
parent510def3e58b99d3fdc5d72c6633257537253ab3d (diff)
downloademacs-8d6fd8d48092177de4dc93c2d929d59b41d98e9e.tar.gz
emacs-8d6fd8d48092177de4dc93c2d929d59b41d98e9e.zip
(with-case-table): Use `make-symbol' to avoid variable capture.
Restore the table in the same buffer.
-rw-r--r--lisp/subr.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 1a49ae6c73e..1a70c53a879 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2485,11 +2485,15 @@ in BODY."
2485 "Execute the forms in BODY with TABLE as the current case table. 2485 "Execute the forms in BODY with TABLE as the current case table.
2486The value returned is the value of the last form in BODY." 2486The value returned is the value of the last form in BODY."
2487 (declare (indent 1) (debug t)) 2487 (declare (indent 1) (debug t))
2488 `(let ((old-case-table (current-case-table))) 2488 (let ((old-case-table (make-symbol "table"))
2489 (unwind-protect 2489 (old-buffer (make-symbol "buffer")))
2490 (progn (set-case-table ,table) 2490 `(let ((,old-case-table (current-case-table))
2491 ,@body) 2491 (,old-buffer (current-buffer)))
2492 (set-case-table old-case-table)))) 2492 (unwind-protect
2493 (progn (set-case-table ,table)
2494 ,@body)
2495 (with-current-buffer ,old-buffer
2496 (set-case-table ,old-case-table))))))
2493 2497
2494;;;; Constructing completion tables. 2498;;;; Constructing completion tables.
2495 2499