emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Regression in #+include behavior [master]
@ 2018-03-19 20:00 Kaushal Modi
  2018-03-19 20:03 ` Kaushal Modi
  2018-03-19 22:52 ` Nicolas Goaziou
  0 siblings, 2 replies; 6+ messages in thread
From: Kaushal Modi @ 2018-03-19 20:00 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 1544 bytes --]

Hello,

I believe a regression was introduced in
https://code.orgmode.org/bzg/org-mode/commit/d81a1d088c74e605c99e90a2835c55df5144f43e

I am unable to come with a minimal example, but I can link to the actual
Org file that causes the failure. If I try to move that subtree along with
the "included" subtrees into a separate Org file, the export works fine.

- Download
https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master/test/site/content-org/all-posts.org
(you can wget or curl that file using that URL).
- Ensure that point is in the "* Alert Shortcode Lookalike" heading (around
line 3416).
- Do C-c C-e C-s h h

You should get an error like this:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  org-element-context()

org-export--prepare-file-contents("/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content-org/
all-posts.org" "3311-3358" 0 5 1 #<hash-table equal 0/65 0x15ea311>
"/home/kmodi/stow/pub_dotfiles/emacs/dot-emacs.d/elisp/ox-hugo/test/site/content-org/
all-posts.org")
  org-export-expand-include-keyword()
  org-export-as(html t nil nil (:output-file
"alert-short-code-lookalike.html"))
  org-export-to-file(html "alert-short-code-lookalike.html" nil t nil nil
nil)
  org-html-export-to-html(nil t nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)

Let me know if this error can be reproduced by the above steps
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2216 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regression in #+include behavior [master]
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Kaushal Modi @ 2018-03-19 20:03 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

On Mon, Mar 19, 2018 at 4:00 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:

> Hello,
>
> I believe a regression was introduced in
> https://code.orgmode.org/bzg/org-mode/commit/d81a1d088c74e605c99e90a2835c55df5144f43e
>

Actually the commit before that would have been the breaking commit as I
was able to "fix" this locally by reverting to
594b2dbae85dca118253fa35b0681c66362587ee and re-evalling ox.el.
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1003 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regression in #+include behavior [master]
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2018-03-19 22:52 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-org list

Hello,


Kaushal Modi <kaushal.modi@gmail.com> writes:

> I believe a regression was introduced in
> https://code.orgmode.org/bzg/org-mode/commit/d81a1d088c74e605c99e90a2835c55df5144f43e
>
> I am unable to come with a minimal example, but I can link to the actual
> Org file that causes the failure. If I try to move that subtree along with
> the "included" subtrees into a separate Org file, the export works fine.
>
> - Download
> https://raw.githubusercontent.com/kaushalmodi/ox-hugo/master/test/site/content-org/all-posts.org
> (you can wget or curl that file using that URL).
> - Ensure that point is in the "* Alert Shortcode Lookalike" heading (around
> line 3416).
> - Do C-c C-e C-s h h
>
> You should get an error like this:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   looking-at(nil)
>   org-element-context()

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regression in #+include behavior [master]
  2018-03-19 22:52 ` Nicolas Goaziou
@ 2018-03-20  3:27   ` Kaushal Modi
  2018-03-20  7:53     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Kaushal Modi @ 2018-03-20  3:27 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 629 bytes --]

On Mon, Mar 19, 2018 at 6:52 PM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

>
> Fixed. Thank you.
>

Hello,

Thank you for quickly fixing this.

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..

I am just including content from one subtree to another in the same file..
What that the corner/pathological case?[1]. Sorry, I didn't quite
understand the test in the commit.


[1]:
https://code.orgmode.org/bzg/org-mode/commit/beeb4bf23fd2b2339c2354457840d52c52d6dff5
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 1169 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regression in #+include behavior [master]
  2018-03-20  3:27   ` Kaushal Modi
@ 2018-03-20  7:53     ` Nicolas Goaziou
  2018-03-21 21:45       ` Kaushal Modi
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2018-03-20  7:53 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-org list

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Regression in #+include behavior [master]
  2018-03-20  7:53     ` Nicolas Goaziou
@ 2018-03-21 21:45       ` Kaushal Modi
  0 siblings, 0 replies; 6+ messages in thread
From: Kaushal Modi @ 2018-03-21 21:45 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

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 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

[-- Attachment #2: Type: text/html, Size: 1642 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-21 21:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-03-21 21:45       ` Kaushal Modi

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).