t...@tsdye.com (Thomas S. Dye) writes:

> Aloha all,
>
> I just discovered that refreshing buffer properties, C-c C-c at the top
> of my Org mode file, resets Local Variables to their default values (I
> think). At any rate, the Local Variables I set at the end of the file
> are changed by refreshing buffer properties.
>

Indeed: by the time org-mode is called, the variables have been
forgotten.

> Is this intended? 
>

I doubt it.

> I end up running M-x normal-mode afterwards, which is sometimes
> difficult to remember.
>
Looking at what normal-mode does, I came up with the following hack.
Does it fix things for you?

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org.el b/lisp/org.el
index febee75..caf0348 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5512,7 +5512,8 @@ 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)))
+  (set-face-foreground 'org-hide (org-find-invisible-foreground))
+  (hack-local-variables))
 
 ;; Update `customize-package-emacs-version-alist'
 (add-to-list 'customize-package-emacs-version-alist
--8<---------------cut here---------------end--------------->8---

-- 
Nick


Reply via email to