From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: [patch] Question on resolving links?
Date: Sun, 21 Sep 2014 00:04:21 +0200 [thread overview]
Message-ID: <874mw26ja2.fsf@gmx.us> (raw)
In-Reply-To: <87oaua8046.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sat, 20 Sep 2014 23:15:21 +0200")
Hi Nicolas,
Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
> Rasmus <rasmus@gmx.us> writes:
>
>> I would like to use #+INCLUDE keywords for inputting headlines from
>> other files. Line-numbers are too volatile and I'm not willing to
>> split up my file.
>
> I think these specifications need to be refined.
If you are saying that INCLUDE needs to be updated I agree.
I was thinking of using normal links with some sort of ATTR, but since
there's not a global ATTR, it's not obvious how to do it.
Perhaps INCLUDE with support for normal links would be enough?
I which direction do you think I should put my effort? [Of course I
want it to be part of ox]
> Should it only include
> the headline and its section, or the whole tree starting at the headline?
I think it should include the target headline. That way I can to "*
preliminary model" (which is good for overview) in my notes.org and
use something more interesting in final.org.
Another reason for this is that then in "notes.org" I would also have
a headline with all of the advantages that entails (moving. not losing
it etc.).
When your "stapling together" together files, you'll include more than
just a heading. . . Are there cases where it makes sense to include
the heading, *when only importing one heading*?
>> The attached patch does not, but I am not very happy about the
>> elegance of the implementation and it relies on a mix of org.el
>> functions and ox functions. Basically, the patch tries to interpret
>> keywords like this:
>>
>> #+INCLUDE: "~/file.org::*foo"
>>
>> Is there not a function to interpret a link-string, say
>> "~/file.org::*foo", particularly with ox?
>
> You cannot do this with ox, as include keywords are expanded before the
> export process actually begins.
OK. Good to know, and somewhat what I expected.
>> The closes thing I found was `org-element-parse-secondary-string` on
>> [[~/file.org::*foo]] which gives me the correct element. Normally,
>> `org-export-resolve-fuzzy-link' should then help me out, but in
>> `org-export-expand-include-keyword' I don't have info! Also,
>> `org-link-search' didn't seem to work across files.
>
> I think `org-open-link-from-string' is what you want:
>
> (org-open-link-from-string "[[~/file.org::*foo]]")
Right! I did not know that one, but it's definitely what I was
looking for. Cool!
—Rasmus
--
Enough with the bla bla!
prev parent reply other threads:[~2014-09-20 22:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-20 20:49 [patch] Question on resolving links? Rasmus
2014-09-20 21:15 ` Nicolas Goaziou
2014-09-20 22:04 ` Rasmus [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874mw26ja2.fsf@gmx.us \
--to=rasmus@gmx.us \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.