瀏覽代碼

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 11 年之前
父節點
當前提交
0911edfac8
共有 1 個文件被更改,包括 2 次插入1 次删除
  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 ()