From 0911edfac881ab17a2cd1670f169ff4bdf1ac486 Mon Sep 17 00:00:00 2001 From: Nick Dokos Date: Mon, 25 Nov 2013 23:38:48 -0500 Subject: [PATCH] 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. --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index c7e0be7b6..92344db2b 100644 --- a/lisp/org.el +++ b/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 ()