From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [patch] Question on resolving links? Date: Sun, 21 Sep 2014 00:04:21 +0200 Message-ID: <874mw26ja2.fsf@gmx.us> References: <87d2aq6mrj.fsf@gmx.us> <87oaua8046.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVSlg-0000kE-05 for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 18:04:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVSlb-0001gR-7c for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 18:04:35 -0400 Received: from mout.gmx.net ([212.227.15.18]:61878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVSla-0001fe-Us for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 18:04:31 -0400 Received: from W530 ([217.130.110.20]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MXI5V-1Xpy9T41Ir-00WI7K for ; Sun, 21 Sep 2014 00:04:23 +0200 In-Reply-To: <87oaua8046.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sat, 20 Sep 2014 23:15:21 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Nicolas, Nicolas Goaziou writes: > Rasmus 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?=20 > > 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! =E2=80=94Rasmus --=20 Enough with the bla bla!