]> git.eshelyaron.com Git - emacs.git/commitdiff
(lm-with-file): Cease enabling 'emacs-lisp-mode'
authorEshel Yaron <me@eshelyaron.com>
Fri, 7 Jun 2024 11:27:17 +0000 (13:27 +0200)
committerEshel Yaron <me@eshelyaron.com>
Fri, 7 Jun 2024 11:27:17 +0000 (13:27 +0200)
This avoids running the mode hook (e.g. turning on Flymake) in
each examined file.

lisp/emacs-lisp/lisp-mnt.el

index f111a77663ca3b02c15433658969c3da5163364e..826198f08331fd239c66dc26b16f37251186be2a 100644 (file)
@@ -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)))))))