From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [patch] Question on resolving links? Date: Sat, 20 Sep 2014 23:15:21 +0200 Message-ID: <87oaua8046.fsf@nicolasgoaziou.fr> References: <87d2aq6mrj.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVRzc-0004Nh-DJ for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 17:15:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVRzQ-0006fS-My for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 17:14:56 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:46342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVRzQ-0006ew-HN for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 17:14:44 -0400 In-Reply-To: <87d2aq6mrj.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 20 Sep 2014 22:49:04 +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: Rasmus Cc: emacs-orgmode@gnu.org Hello, 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. Should it only include the headline and its section, or the whole tree starting at the headline? > 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. > 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]]") Regards, -- Nicolas Goaziou