From: Michael Brand <michael.ch.brand@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: new exporter: link abbrev
Date: Thu, 6 Dec 2012 16:13:26 +0100 [thread overview]
Message-ID: <CALn3zoi9vjP+m__DgPsO4fcbgOoaY=9vz6nHzm5NhEsPxW1pdA@mail.gmail.com> (raw)
In-Reply-To: <87y5hctdk3.fsf@gmail.com>
Hi Nicolas
On Wed, Dec 5, 2012 at 10:05 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> The second one is a more difficult problem. Org Elements usually
> translates links on the fly when parsing them: `org-element-link-parser'
> calls `org-translate-link'. This function requires
> `org-link-abbrev-alist' and `org-link-abbrev-alist-local' variables to
> be set properly, the second one being a local variable.
>
> Unfortunately, parsing of secondary strings (in particular headline
> titles or inline footnote definitions) happens in a temporary buffer,
> where no local variable is set. There `org-link-abbrev-alist-local' is
> nil, no matter what your #+LINK: keyword says, and link translation
> can't happen.
>
> Also, local variables cannot be send to the temporary buffer, because
> secondary string parsing can sometimes happen when the original buffer
> isn't supposed to exist, that is during export (when the parse tree is
> the only trusted data).
Thank you for the explanations.
> A possible solution would be to move link translation from
> org-element.el to org-export.el. But that would require to explicitly
> call a translator function on links, which would be an additional task
> for back-end developers. Also, `org-element-context' would not return
> anymore the real path of the abbreviated link, only its raw path.
I would like to not burden back-end developers with this.
In the meantime I found out that I can simply add
org-export-normalize-links to org-export-before-processing-hook and it
seems to do what I expect. But this is probably not to be included in
Org core because the (hopefully at least only basic) pre-parsing of
org-export-normalize-links undermines the later parsing of
org-elements. In case org-export-normalize-links would survive the old
exporter (I fear it will not) the workaround of hooking would do it
for me.
Michael
next prev parent reply other threads:[~2012-12-06 15:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-03 15:20 new exporter: link abbrev Michael Brand
2012-12-04 11:40 ` Jambunathan K
2012-12-04 14:59 ` Bastien
2012-12-05 21:05 ` Nicolas Goaziou
2012-12-06 15:13 ` Michael Brand [this message]
2012-12-18 21:21 ` Nicolas Goaziou
2012-12-19 11:10 ` Michael Brand
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='CALn3zoi9vjP+m__DgPsO4fcbgOoaY=9vz6nHzm5NhEsPxW1pdA@mail.gmail.com' \
--to=michael.ch.brand@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@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).