diff options
author | Richard M. Stallman <rms@gnu.org> | 2005-01-15 18:16:44 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2005-01-15 18:16:44 +0000 |
commit | d4b6c2e3326c888da19e2be60899a27ef8a16f0a (patch) | |
tree | d8b4c86a47bd49e8d45095600aa341ce3ef5e6fc /lisp/emacs-lisp | |
parent | 5a77048aef1ab0dc4a18a02fbf852f4a509e9b93 (diff) | |
download | emacs-d4b6c2e3326c888da19e2be60899a27ef8a16f0a.tar.gz emacs-d4b6c2e3326c888da19e2be60899a27ef8a16f0a.tar.bz2 emacs-d4b6c2e3326c888da19e2be60899a27ef8a16f0a.zip |
(lm-with-file): Use Lisp mode in temp buffer.
In non-temp buffer, switch syntax table temporarily.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp-mnt.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index 671f3c8ce2a..701da1c4dec 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -304,9 +304,14 @@ If FILE is nil, execute BODY in the current buffer." (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) |