diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-11-11 00:39:53 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-11-11 00:39:53 +0900 |
commit | 4dd1f56f29fc598a8339a345c2f8945250600602 (patch) | |
tree | af341efedffe027e533b1bcc0dbf270532e48285 /lisp/textmodes/conf-mode.el | |
parent | 4c49ec7f865bdad1629d2f125f71f4e506b258f2 (diff) | |
parent | 810fa21d26453f898de9747ece7205dfe6de9d08 (diff) | |
download | emacs-4dd1f56f29fc598a8339a345c2f8945250600602.tar.gz emacs-4dd1f56f29fc598a8339a345c2f8945250600602.tar.bz2 emacs-4dd1f56f29fc598a8339a345c2f8945250600602.zip |
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lisp/textmodes/conf-mode.el')
-rw-r--r-- | lisp/textmodes/conf-mode.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/textmodes/conf-mode.el b/lisp/textmodes/conf-mode.el index 5f34ae152d1..30f8fd0ca91 100644 --- a/lisp/textmodes/conf-mode.el +++ b/lisp/textmodes/conf-mode.el @@ -417,12 +417,18 @@ See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode', ;; To tell the difference between those two cases where the function ;; might be called, we check `delay-mode-hooks'. ;; (inspired from tex-mode.el) +(defvar conf-mode--recursing nil) (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 ((conf-mode--recursing conf-mode--recursing)) + (funcall (if (or delay-mode-hooks conf-mode--recursing) + orig-fun + (setq conf-mode--recursing t) + (conf--guess-mode)))))) (defun conf-mode-initialize (comment &optional font-lock) "Initializations for sub-modes of `conf-mode'. @@ -609,7 +615,7 @@ For details see `conf-mode'. Example: (conf-mode-initialize "!")) (defun conf-toml-recognize-section (limit) - "Font-lock helper function for conf-toml-mode. + "Font-lock helper function for `conf-toml-mode'. Handles recognizing TOML section names, like [section], \[[section]], or [something.\"else\".section]." (save-excursion |