From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Variable settings in .emacs VS cross device portability. Date: Thu, 02 Feb 2012 18:38:39 -1000 Message-ID: References: <87k448y9gp.fsf@gmx.com> <87ehuf4rar.fsf@ucl.ac.uk> <877h06twg3.fsf@ucl.ac.uk> <3156.1328128664@alphaville> <87y5sl1an1.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtAv1-0003eh-BJ for emacs-orgmode@gnu.org; Thu, 02 Feb 2012 23:38:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtAuz-0004pw-So for emacs-orgmode@gnu.org; Thu, 02 Feb 2012 23:38:39 -0500 Received: from oproxy4-pub.bluehost.com ([69.89.21.11]:39207) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RtAuz-0004ps-HZ for emacs-orgmode@gnu.org; Thu, 02 Feb 2012 23:38:37 -0500 In-Reply-To: <87y5sl1an1.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Thu, 2 Feb 2012 16:08:02 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: org-mode mailing list Hi Eric, Eric S Fraga writes: > Nick Dokos writes: > > [...] > >> Good question (I mean the *How* question): I believe this is a bug and >> it has to do with the problem that Dan Davison identified and (as it >> turns out) partially fixed a year ago (see >> http://thread.gmane.org/gmane.emacs.orgmode/35439/focus=36878 for those >> details). >> >> In a nutshell, the problem is that many export operations happen in >> temporary buffers. These buffers do not automatically inherit local > > [...] > > Nick, > > Many thanks for this analysis. My gut feeling was indeed correct > (whew!), probably because I subconsciously remembered reading the thread > from Dan Davison. > >> The quick-and-dirty hack would be to call Dan's cloning function in the >> call to with-temp-buffer, but that's not enough: >> org-export-latex-fontify-headline does the temp-buffer thingie as well >> and needs the same treatment. That seems to make *this* case work but I'm >> almost 100% sure that that won't be enough in the general case either: >> there are probably other places where temp buffers are created to do >> some processing like this. They will also be subject to this problem. > > I must admit I am confused as to the point of #+BIND now. I had thought > the whole purpose was to set variables to be used during the export > process but now it seems this is not the case. Or it is only the case > for some subset of the variables that may affect the export process. > > I don't care whether I need to use file local variables, #+BIND, or any > other mechanism but it would be nice to have some mechanism! So, can > anybody suggest any hack around this problem? I am not terribly worried > about this as it only causes me difficulties now and again when I have a > specific type of document I need to generate for > dissemination. Usually, my default settings are fine. However, it > would be nice to have some solution to this. > > I can have an emacs lisp code block which gets executed to set > the values of those variables. This works (see attachment), so long as > I don't have any other controls for settings these variables, including > file local variables or #+BIND. However, I need to manually execute > this code block if it is hidden away in a not-exported region of the > document. Otherwise, it clogs up the text (but such is life!). > > Note, however, that this changes the variable value globally and so will > affect exporting of any other subsequent org documents unless they have > their own settings. Not *good* but good enough for my own use case for > the moment... and, actually, having explicit settings for export > variables in every *important* document is probably not a bad > idea. Ummm, need to think about this. If you (and the receiver) tangle your export-settings source code block to init.el (:tangle init.el), then execute something like the following source code block #+begin_src sh emacs -Q -l init.el examplebug.org #+end_src you should be able to ensure that the receiver will get the same result you get. Of course, anything in your .emacs (or other initialization files) that is needed to produce the results will need to be included in export-settings. hth, Tom > > > #+TITLE: examplebug.org > #+AUTHOR: Eric S Fraga > #+EMAIL: e.fraga@ucl.ac.uk > #+DATE: 2012-01-09 Mon > > * Formatting tags :example: > When exporting, the default is to put tags in bold. I want a box around them. > > > # the following is used to set some variables which affect export to latex > #+name: export-settings > #+begin_src emacs-lisp :exports results :results silent > (setq org-export-latex-tag-markup "babel: \\fbox{%s}") > #+end_src > > > > Anyway, thanks again, > eric -- Thomas S. Dye http://www.tsdye.com