emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "M. ‘quintus’ Gülker" <post+orgmodeml@guelker.eu>
To: emacs-orgmode@gnu.org
Subject: Re: local variables and export processing in hooks
Date: Wed, 10 Feb 2021 21:56:10 +0100	[thread overview]
Message-ID: <20210210205610.GC6355@atlantis> (raw)
In-Reply-To: <5917189e-3c8d-0854-561d-3af02a3868b4@posteo.eu>

Am 09. Februar 2021 um 14:21 Uhr +0100 schrieb Sébastien Miquel:
> Eric S Fraga writes:
> > I tried but this doesn't seem to be propagated to the export as the
> > export works on a copy of the buffer, not the buffer itself.  That's
> > what #+BIND is for, supposedly...
> 
> I think this buffer copy preserves local variables. I know I use a such a
> local variable and its value can be read during macro expansion.
> 
> It seems the org-export-before-parsing-hook functions are run before the
> #+BIND values are collected (see org-export-as in ox.el).

Interesting. I did not know about #+BIND, but just today I came about
the issue where I needed file-local variables to be available both in
the org-export-before-parsing-hook and in macro expansion. I
circumvented the problem by picking the original buffer out of
`buffer-list' and temporaryly switching to that buffer with
`with-current-buffer'.

Now I wonder whether #+BIND is more elegant. But my macro expansion
function modifies a buffer-local variable. Does #+BIND allow for that,
so that the changed value is available in the original org buffer?

  -quintus

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu |    For security:
Passau, Germany      | kontakt@guelker.eu    | () Avoid HTML e-mail
European Union       | PGP: see homepage     | /\ http://asciiribbon.org


  parent reply	other threads:[~2021-02-10 21:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 10:13 local variables and export processing in hooks Eric S Fraga
2021-02-09 11:30 ` tomas
2021-02-09 12:06   ` Eric S Fraga
2021-02-09 13:21     ` Sébastien Miquel
2021-02-10  8:48       ` Eric S Fraga
2021-02-10 20:56       ` M. ‘quintus’ Gülker [this message]
2021-02-11 20:12         ` Sébastien Miquel
2021-02-12  7:28           ` M. ‘quintus’ Gülker
2021-02-10 15:43     ` Maxim Nikulin
2021-02-11  8:50       ` Eric S Fraga

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=20210210205610.GC6355@atlantis \
    --to=post+orgmodeml@guelker.eu \
    --cc=emacs-orgmode@gnu.org \
    /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).