changeset 59572:3cd31d377b69

(lm-with-file): Use Lisp mode in temp buffer. In non-temp buffer, switch syntax table temporarily.
author Richard M. Stallman <rms@gnu.org>
date Sat, 15 Jan 2005 18:15:46 +0000
parents 04043e03826a
children 208685234719
files lisp/emacs-lisp/lisp-mnt.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)