Browse Source

Second try: Ensure that file local variables are set

* lisp/org.el (org-mode-restart): Call normal-mode,
  instead of org-mode. This will set the mode but it
  will also set file local variables properly.

Reported by Tom Dye: C-c C-c on e.g an #+OPTIONS line
would lose file local variable settings.

The original fix (commit 5ea0228) was incorrect: if the
local variable was a mode setting, then we ended up in an
"infinite" recursion. Problem found, reported and a reproducer
provided by York Zhao.
Nick Dokos 6 years ago
parent
commit
0911edfac8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org.el

+ 2 - 1
lisp/org.el

@@ -20466,7 +20466,8 @@ This command does many different things, depending on context:
   "Restart Org-mode, to scan again for special lines.
 Also updates the keyword regular expressions."
   (interactive)
-  (org-mode)
+  ;; this will set the mode *and* set file local variables.
+  (normal-mode)
   (message "Org-mode restarted"))
 
 (defun org-kill-note-or-show-branches ()