emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Buffer local value lost when exporting? (was Evaluate all org tables in file before exporting)
Date: Fri, 13 May 2016 08:04:40 +0100	[thread overview]
Message-ID: <87mvnujv5j.fsf@ucl.ac.uk> (raw)
In-Reply-To: <1ce7789874d84d4d861eabf587693621@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Kaushal Modi's message of "Thu, 12 May 2016 15:54:09 +0000")

On Thursday, 12 May 2016 at 15:54, Kaushal Modi wrote:
> Hi all,
>
> I almost have a squeaky clean solution to this thanks to the hint
> provided by someone on emacs.SE (
> http://emacs.stackexchange.com/a/22215/115 ).
>
> But in the process, I seem to have stumbled upon a bug.. the buffer
> local value of variables are not respected at the time of exports.

It's not a bug but a known design feature.  A new buffer is created as
part of the export process and this buffer does not inherit local
variable values.  What you need to do is tell org to set specific
variables upon export.  You can use the #+BIND: directive to do this.

I don't know where this is documented but there is mention of whether to
allow this to happen in the org info manual:

   If ‘org-export-allow-bind-keywords’ is non-‘nil’, Emacs variables can
   become buffer-local during export by using the BIND keyword.  Its
   syntax is ‘#+BIND: variable value’.  This is particularly useful for
   in-buffer settings that cannot be changed using specific keywords.

Give this a try.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-775-g3308a5

  parent reply	other threads:[~2016-05-13  7:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 14:58 Evaluate all org tables in file before exporting? Kaushal Modi
2016-05-12 15:54 ` Buffer local value lost when exporting? (was Evaluate all org tables in file before exporting) Kaushal Modi
2016-05-12 16:58   ` Kaushal Modi
     [not found] ` <1ce7789874d84d4d861eabf587693621@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-05-13  7:04   ` Eric S Fraga [this message]
2016-05-13 16:22     ` Kaushal Modi
2016-05-13 16:25     ` Nicolas Goaziou
2016-05-13 16:33       ` Kaushal Modi
2016-05-14  8:25         ` Nicolas Goaziou

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=87mvnujv5j.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).