emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Refresh buffer properties and local variables
Date: Thu, 21 Nov 2013 00:37:01 -0500	[thread overview]
Message-ID: <87eh6a1fk2.fsf@gmail.com> (raw)
In-Reply-To: m1bo1f4z3x.fsf@poto.westell.com

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

tsd@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.
> Is this intended? 
> I end up running M-x normal-mode afterwards, which is sometimes
> difficult to remember.
> All the best,
> Tom

Patch attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to ensure that file local variables are set properly --]
[-- Type: text/x-diff, Size: 1206 bytes --]

From 5ea02285bacb9592b20c95d4797ca7c2ec68ecac Mon Sep 17 00:00:00 2001
From: Nick Dokos <ndokos@gmail.com>
Date: Thu, 21 Nov 2013 00:30:05 -0500
Subject: [PATCH] Ensure that file local variables are set

* lisp/org.el (org-mode): Call `hack-local-variables'
  at the end of `org-mode' to set file local variables.
  Cribbed from `normal-mode'.

Reported by Tom Dye: C-c C-c on e.g an #+OPTIONS line
would lose file local variable settings.
 lisp/org.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index febee75..8539f51 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5512,7 +5512,10 @@ The following commands are available:
      (unless org-inhibit-startup-visibility-stuff
   ;; Try to set org-hide correctly
-  (set-face-foreground 'org-hide (org-find-invisible-foreground)))
+  (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)))
 ;; Update `customize-package-emacs-version-alist'
 (add-to-list 'customize-package-emacs-version-alist

[-- Attachment #3: Type: text/plain, Size: 10 bytes --]


  parent reply	other threads:[~2013-11-21  5:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  1:54 Refresh buffer properties and local variables Thomas S. Dye
2013-11-20  3:26 ` Nick Dokos
2013-11-20 18:28   ` Thomas S. Dye
2013-11-20 18:38     ` Bastien
2013-11-20 19:47       ` Nick Dokos
2013-11-21  5:37 ` Nick Dokos [this message]
2013-11-21  7:13   ` Bastien
2013-11-21 13:51     ` Nick Dokos
2013-11-21 17:08       ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh6a1fk2.fsf@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).