emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Regression in #+include behavior [master]
Date: Tue, 20 Mar 2018 08:53:21 +0100	[thread overview]
Message-ID: <87sh8vb2tq.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAFyQvY1X459w8Pz62BGb9PGMC0WVq4j76Eg8sZN5PPoffiAhuA@mail.gmail.com> (Kaushal Modi's message of "Tue, 20 Mar 2018 03:27:02 +0000")

Hello,

Kaushal Modi <kaushal.modi@gmail.com> 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

  reply	other threads:[~2018-03-20  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 20:00 Regression in #+include behavior [master] Kaushal Modi
2018-03-19 20:03 ` Kaushal Modi
2018-03-19 22:52 ` Nicolas Goaziou
2018-03-20  3:27   ` Kaushal Modi
2018-03-20  7:53     ` Nicolas Goaziou [this message]
2018-03-21 21:45       ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh8vb2tq.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).