# HG changeset patch # User Richard M. Stallman # Date 1105812946 0 # Node ID 3cd31d377b69b411bf5b0cf9c9193fa03ea4e975 # Parent 04043e03826ab7e44e427a0e1d8a38260857553b (lm-with-file): Use Lisp mode in temp buffer. In non-temp buffer, switch syntax table temporarily. diff -r 04043e03826a -r 3cd31d377b69 lisp/emacs-lisp/lisp-mnt.el --- a/lisp/emacs-lisp/lisp-mnt.el Sat Jan 15 18:11:33 2005 +0000 +++ b/lisp/emacs-lisp/lisp-mnt.el Sat Jan 15 18:15:46 2005 +0000 @@ -304,9 +304,14 @@ (if ,filesym (with-temp-buffer (insert-file-contents ,filesym) + (lisp-mode) ,@body) (save-excursion - ,@body))))) + ;; Switching major modes is too drastic, so just switch + ;; temporarily to the Lisp mode syntax table. + (with-syntax-table lisp-mode-syntax-table + ,@body)))))) + (put 'lm-with-file 'lisp-indent-function 1) (put 'lm-with-file 'edebug-form-spec t)