From: Gerd Moellmann Date: Sun, 21 Nov 1999 15:08:37 +0000 (+0000) Subject: (with-syntax-table): Don't switch buffers. X-Git-Tag: emacs-pretest-21.0.90~6036 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c29cefdfa0bdaf07067afa074c89adf120c1b1f9;p=emacs.git (with-syntax-table): Don't switch buffers. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e701e21a873..fadfd09a6f3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 1999-11-21 Gerd Moellmann + * simple.el (with-syntax-table): Don't switch buffers. + * emacs-lisp/edebug.el, emacs-lisp/cust-print.el, progmodes/hideif.el: Use new backquote syntax. diff --git a/lisp/simple.el b/lisp/simple.el index bc78fc66f99..c1fa29bec62 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4142,8 +4142,8 @@ after it has been set up properly in other respects." (defmacro with-syntax-table (table &rest body) "Evaluate BODY with syntax table of current buffer set to a copy of TABLE. -Current buffer and syntax table are saved, BODY is evaluated, and the -saved values are restored, even in case of an abnormal exit. +The syntax table of the current buffer is saved, BODY is evaluated, and the +saved table is restored, even in case of an abnormal exit. Value is what BODY returns." (let ((old-table (gensym)) (old-buffer (gensym))) @@ -4153,8 +4153,9 @@ Value is what BODY returns." (progn (set-syntax-table (copy-syntax-table ,table)) ,@body) - (set-buffer ,old-buffer) - (set-syntax-table ,old-table))))) + (save-current-buffer + (set-buffer ,old-buffer) + (set-syntax-table ,old-table)))))) (put 'with-syntax-table 'lisp-indent-function 1) (put 'with-syntax-table 'edebug-form-spec '(form body))