1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-07 15:00:34 -08:00

(lm-with-file): Use Lisp mode in temp buffer.

In non-temp buffer, switch syntax table temporarily.
This commit is contained in:
Richard M. Stallman 2005-01-15 18:16:44 +00:00
parent 5a77048aef
commit d4b6c2e332
2 changed files with 33 additions and 1 deletions

View file

@ -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)