Nick Dokos <ndo...@gmail.com> writes:

> The best solution I can think of so far: revert commit 5ea0228,
> and change org-mode-restart to call normal-mode, instead of org-mode.
> normal-mode splits the setting of the mode from the setting of local
> variables, so it would avoid the recursion.
>
> I think (but I have not verified yet) that this would fix both the
> problem that gave rise to commit 5ea0228 in the first place and this
> bottomless recursion, without causing any other problems. I'll try it
> out tomorrow if I find the time and submit a patch.

Patch attached. It passed the two tests, but I have not done anything
more. Can both interested parties (York Zhao and Tom Dye) please test it
and let me know of any problems?

diff --git a/lisp/org.el b/lisp/org.el
index 7a4d244..677d298 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5512,10 +5512,7 @@ The following commands are available:
      (unless org-inhibit-startup-visibility-stuff
        (org-set-startup-visibility))))
   ;; Try to set org-hide correctly
-  (set-face-foreground 'org-hide (org-find-invisible-foreground))
-  ;; Make sure that file local variables are set.
-  (report-errors "File local-variables error: %s"
-    (hack-local-variables)))
+  (set-face-foreground 'org-hide (org-find-invisible-foreground)))
 
 ;; Update `customize-package-emacs-version-alist'
 (add-to-list 'customize-package-emacs-version-alist
@@ -20469,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 ()
Thanks,
-- 
Nick

Reply via email to