From: Eshel Yaron Date: Fri, 7 Jun 2024 11:27:17 +0000 (+0200) Subject: (lm-with-file): Cease enabling 'emacs-lisp-mode' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0d7cf0a3eb0320c9283f9b6afa61ee6d34bd0ff4;p=emacs.git (lm-with-file): Cease enabling 'emacs-lisp-mode' This avoids running the mode hook (e.g. turning on Flymake) in each examined file. --- diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index f111a77663c..826198f0833 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -288,14 +288,12 @@ If FILE is nil, execute BODY in the current buffer." (if ,filesym (with-temp-buffer (insert-file-contents ,filesym) - (emacs-lisp-mode) - ,@body) + (with-syntax-table emacs-lisp-mode-syntax-table + ,@body)) (save-excursion (save-restriction (widen) (goto-char (point-min)) - ;; Switching major modes is too drastic, so just switch - ;; temporarily to the Emacs Lisp mode syntax table. (with-syntax-table emacs-lisp-mode-syntax-table ,@body)))))))