emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Add :target option for the TOC keyword


From: Sacha Chua
Subject: Re: [O] [PATCH] Add :target option for the TOC keyword
Date: Wed, 29 May 2019 11:40:53 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

Hello, Nicolas!

> Thank you! I cannot guess the use case, but you certainly have one :)

I'm guessing DC Toedt likes to make Org files that have some kind of
overview TOC in a different section. I haven't used it myself, but it
seems like a potentially handy thing to have.

> Even if this doesn't sound like a very common need, it doesn't add too
> much overhead to the code base either. It would be nice if it really
> generalized "local" keyword, i.e., with ":target local", "local" variant
> being supported but not documented.

The old way just did a simple regular expression search for local, so
:target local actually already works. :target "local" tries to do a
fuzzy search for a headline with "local" text in it, though. Is that
what you mean? I'm not sure if the best approach would be to:

- catch the signal raised by org-export-resolve-fuzzy-link and then check for 
the
special case of "local"
- always handle :target "local" as a local TOC
- or just leave the behaviour as it is. What would you recommend?

> Also, there seems to be much code duplication in the export back-ends.
> Would it make sense to factor this out into a function in "ox.el". For
> example, `org-export-resolve-link-string' or some such? With some tests
> for bonus points.

I made an org-export-resolve-link that can take string or link objects.
It doesn't handle all the potential link types, though, just id and
fuzzy.

Attachment: 0001-Add-target-option-for-the-TOC-keyword.patch
Description: Text Data

Sacha

reply via email to

[Prev in Thread] Current Thread [Next in Thread]