From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Regression in #+include behavior [master] Date: Wed, 21 Mar 2018 21:45:28 +0000 Message-ID: References: <871sgfd6f4.fsf@nicolasgoaziou.fr> <87sh8vb2tq.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b9046f0567f31cbb" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eylYF-0002CO-8M for emacs-orgmode@gnu.org; Wed, 21 Mar 2018 17:45:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eylYD-0000kR-Fg for emacs-orgmode@gnu.org; Wed, 21 Mar 2018 17:45:43 -0400 Received: from mail-yb0-x236.google.com ([2607:f8b0:4002:c09::236]:46813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eylYD-0000jt-A4 for emacs-orgmode@gnu.org; Wed, 21 Mar 2018 17:45:41 -0400 Received: by mail-yb0-x236.google.com with SMTP id t5-v6so2258368ybg.13 for ; Wed, 21 Mar 2018 14:45:41 -0700 (PDT) In-Reply-To: <87sh8vb2tq.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-org list --000000000000b9046f0567f31cbb Content-Type: text/plain; charset="UTF-8" On Tue, Mar 20, 2018 at 3:53 AM Nicolas Goaziou wrote: > > 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. That was a pathological test case for ox-hugo :) > 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. > Thanks! It makes sense now. > 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. > -- Kaushal Modi --000000000000b9046f0567f31cbb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Mar 20= , 2018 at 3:53 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

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 li= nk
[[http= s://example.org][here]] (Awesome!)" headline.
That was a pathological test case for ox-hugo :)
=C2=A0
There, `org-element-context' needed to check the headline, by (looking-at
org-complex-heading-regexp). However, since the changes were happening in F= undamental mode, the regexp was not set. Hence the error.
<= div>
Thanks! It makes sense now.
=C2=A0
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
=C2=A0 directory,
- switch to Org mode before proceeding with changes.
--

Kaushal Modi

--000000000000b9046f0567f31cbb--