From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Buffer local value lost when exporting? (was Evaluate all org tables in file before exporting) Date: Fri, 13 May 2016 16:22:53 +0000 Message-ID: References: <1ce7789874d84d4d861eabf587693621@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87mvnujv5j.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0441f47167c10532bbb0bb Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1Frm-000441-QC for emacs-orgmode@gnu.org; Fri, 13 May 2016 12:23:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1Frl-0003ME-1A for emacs-orgmode@gnu.org; Fri, 13 May 2016 12:23:06 -0400 Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:34500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1Frk-0003MA-Qr for emacs-orgmode@gnu.org; Fri, 13 May 2016 12:23:04 -0400 Received: by mail-oi0-x229.google.com with SMTP id k142so178536650oib.1 for ; Fri, 13 May 2016 09:23:04 -0700 (PDT) In-Reply-To: <87mvnujv5j.fsf@ucl.ac.uk> 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" To: Eric S Fraga Cc: emacs-org list --94eb2c0441f47167c10532bbb0bb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, May 13, 2016 at 3:04 AM Eric S Fraga wrote: > 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. Hi Eric, I think this is a bug because the comments in the code say that the buffer local values should be preserved. The org-export-before-processing-hook is called in ox.el in the org-export-with-buffer-copy macro form ( http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/ox.el?id=3D1c923b9ae7343= 04b0dc6688ee056864facb7c3b8#n3002 ) and org-export-with-buffer-copy macro docstring says: Apply BODY in a copy of the current buffer. The copy preserves local variables, visibility and contents of the original buffer. Point is at the beginning of the buffer when BODY is applied. So I was led to believe that the local variables will be preserved.. Or are they lost at a later stage? > 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 =E2=80=98org-export-allow-bind-keywords=E2=80=99 is non-=E2=80=98ni= l=E2=80=99, Emacs variables can > become buffer-local during export by using the BIND keyword. Its > syntax is =E2=80=98#+BIND: variable value=E2=80=99. This is particula= rly useful for > in-buffer settings that cannot be changed using specific keywords. > > Give this a try. I'll dig into this and get back to you. Thanks. --=20 --=20 Kaushal Modi --94eb2c0441f47167c10532bbb0bb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, May 13= , 2016 at 3:04 AM Eric S Fraga <e.f= raga@ucl.ac.uk> wrote:
It= 9;s not a bug but a known design feature.=C2=A0 A new buffer is created as<= br> part of the export process and this buffer does not inherit local
variable values.=C2=A0

Hi Eric, I think thi= s is a bug because the comments in the code say that the buffer local value= s should be preserved.

The org-export-before-proce= ssing-hook is called in ox.el in the org-export-with-buffer-copy macro form= ( http://orgmode.org/cgit.= cgi/org-mode.git/tree/lisp/ox.el?id=3D1c923b9ae734304b0dc6688ee056864facb7c= 3b8#n3002=C2=A0) =C2=A0and org-export-with-buffer-copy macro docstring = says:

Apply BODY in a copy of the current buf= fer.
The copy preserves local variables, visibility and contents = of
the original buffer.=C2=A0 Point is at the beginning of the bu= ffer
when BODY is applied.

So I wa= s led to believe that the local variables will be preserved.. Or are they l= ost at a later stage?
=C2=A0
= What you need to do is tell org to set specific
variables upon export.=C2=A0 You can use the #+BIND: directive to do this.<= br>
I don't know where this is documented but there is mention of whether t= o
allow this to happen in the org info manual:

=C2=A0 =C2=A0If =E2=80=98org-export-allow-bind-keywords=E2=80=99 is non-=E2= =80=98nil=E2=80=99, Emacs variables can
=C2=A0 =C2=A0become buffer-local during export by using the BIND keyword.= =C2=A0 Its
=C2=A0 =C2=A0syntax is =E2=80=98#+BIND: variable value=E2=80=99.=C2=A0 This= is particularly useful for
=C2=A0 =C2=A0in-buffer settings that cannot be changed using specific keywo= rds.

Give this a try.

I'll dig into this and= get back to you.=C2=A0

Thanks.
<= div dir=3D"ltr">--

--
Kaushal Modi

--94eb2c0441f47167c10532bbb0bb--