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.
This commit is contained in:
Nick Dokos 2013-11-25 23:38:48 -05:00
parent a82a5206f3
commit 0911edfac8
1 changed files with 2 additions and 1 deletions

View File

@ -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 ()