# HG changeset patch # User Gerd Moellmann # Date 942872997 0 # Node ID 46323650988d529d40ef7d0fa681b1c6266669cc # Parent 7bd41cca7ed838a1649d7d42d2d10a50f8e36aa2 (with-syntax-table): Save buffer explicitly instead of using save-excursion. diff -r 7bd41cca7ed8 -r 46323650988d lisp/simple.el --- a/lisp/simple.el Wed Nov 17 21:08:37 1999 +0000 +++ b/lisp/simple.el Wed Nov 17 21:09:57 1999 +0000 @@ -4139,16 +4139,19 @@ (defmacro with-syntax-table (table &rest body) "Evaluate BODY with syntax table of current buffer set to a copy of TABLE. -Point, mark, current buffer, and syntax table are saved, BODY is -evaluated, and the saved values are restored, even in case of an -abnormal exit. Value is what BODY returns." - (let ((old-table (gensym))) - '(let ((,old-table (syntax-table))) +Current buffer and syntax table are saved, BODY is evaluated, and the +saved values are restored, even in case of an abnormal exit. +Value is what BODY returns." + (let ((old-table (gensym)) + (old-buffer (gensym))) + '(let ((,old-table (syntax-table)) + (,old-buffer (current-buffer))) (unwind-protect - (save-excursion + (progn (set-syntax-table (copy-syntax-table ,table)) ,@body) - (set-syntax-table ,old-table))))) + (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))