From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Regression in #+include behavior [master] Date: Tue, 20 Mar 2018 08:53:21 +0100 Message-ID: <87sh8vb2tq.fsf@nicolasgoaziou.fr> References: <871sgfd6f4.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyC5J-0008JQ-1N for emacs-orgmode@gnu.org; Tue, 20 Mar 2018 03:53:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyC5F-0004pl-WC for emacs-orgmode@gnu.org; Tue, 20 Mar 2018 03:53:29 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:51193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eyC5F-0004nK-OQ for emacs-orgmode@gnu.org; Tue, 20 Mar 2018 03:53:25 -0400 In-Reply-To: (Kaushal Modi's message of "Tue, 20 Mar 2018 03:27:02 +0000") 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: Kaushal Modi Cc: emacs-org list Hello, Kaushal Modi writes: > Though I didn't understand why it failed when exporting from the large > file, but not when moving the relevant subtrees (where the #+include was > called, and the included) to a separate file.. The code was fixing links in the whole document, not only in the subtree you were including. The problem lay somewhere else in the file, in the "* Hey! I have a link [[https://example.org][here]] (Awesome!)" headline. There, `org-element-context' needed to check the headline, by (looking-at org-complex-heading-regexp). However, since the changes were happening in Fundamental mode, the regexp was not set. Hence the error. So, the fix implements the following changes: - only modify links withing the included part of the document, - do not modify anything if includer and includee both live in the same directory, - switch to Org mode before proceeding with changes. Regards, -- Nicolas Goaziou