]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix infinite recursion of conf-mode
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 20 Aug 2021 13:55:24 +0000 (15:55 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 20 Aug 2021 13:55:24 +0000 (15:55 +0200)
* lisp/textmodes/conf-mode.el (conf-mode): Inhibit recursion when
called from file-local variables (bug#50126).

lisp/textmodes/conf-mode.el

index 5f34ae152d1a58c77bff313ec31983e494682537..949d8cbdab94c9ffcc073c11c27277870128e4d6 100644 (file)
@@ -420,7 +420,11 @@ See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode',
 (advice-add 'conf-mode :around
             (lambda (orig-fun)
               "Redirect to one of the submodes when called directly."
-              (funcall (if delay-mode-hooks orig-fun (conf--guess-mode)))))
+              ;; The file may have "mode: conf" in the local variable
+              ;; block, in which case we'll be called recursively
+              ;; infinitely.  Inhibit that.
+              (let ((enable-local-variables nil))
+                (funcall (if delay-mode-hooks orig-fun (conf--guess-mode))))))