From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: How to keep correct filepaths when using the #+INCLUDE derivative? Date: Wed, 28 Feb 2018 18:51:09 +0100 Message-ID: <87woyxhuk2.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er5su-00061V-2K for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 12:51:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er5sp-0002Fl-HX for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 12:51:20 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:51500) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1er5sp-0002EI-BD for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 12:51:15 -0500 In-Reply-To: (Daniel P. Gomez's message of "Wed, 28 Feb 2018 14:29:57 +0100") 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" To: Daniel P Gomez Cc: emacs-orgmode@gnu.org Hello, Daniel P Gomez writes: > If I include a file child.org in parent.org using the #+INCLUDE > derivative, and the following two conditions are true: > > 1. child.org and parent.org are not in the same directory nor share > directory structure, > 2. child.org contains file links with relative file paths, > > then exporting parent.org will produce a file with broken links. > > Is there a way to have org sort this out? > > Or even make this optional, > say by using: > > #+INCLUDE: child.org :fix-paths t > > I guess the quickest (but perhaps not cleanest) way to have this > feature would be to convert relative paths in file links into absolute > paths within `org-export-expand-include-keyword`. I'm not that well > versed in Elisp yet to do this yet, though. > > Are there any known solutions to this, or suggestions on how to get it > working? As you suggest, I would use a parse tree filter that turns every relative file link into an absolute one. Regards, -- Nicolas Goaziou