summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-20 15:55:24 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-20 15:55:24 +0200
commitc2026cf3667c0b68a99deed2896b97ce2cf7f5cb (patch)
tree3021dafd24de50d6e211163598a168e0965b4b9a /lisp/textmodes
parent657fe8b9d87dd17d9b50dd8e15bfd917c6c630b2 (diff)
downloademacs-c2026cf3667c0b68a99deed2896b97ce2cf7f5cb.tar.gz
emacs-c2026cf3667c0b68a99deed2896b97ce2cf7f5cb.tar.bz2
emacs-c2026cf3667c0b68a99deed2896b97ce2cf7f5cb.zip
Fix infinite recursion of conf-mode
* lisp/textmodes/conf-mode.el (conf-mode): Inhibit recursion when called from file-local variables (bug#50126).
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/conf-mode.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el
index 5f34ae152d1..949d8cbdab9 100644
--- a/lisp/textmodes/conf-mode.el
+++ b/lisp/textmodes/conf-mode.el
@@ -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))))))