Re: [O] Regression in #+include behavior [master]

2018-03-21 Thread Kaushal Modi
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


Re: [O] Regression in #+include behavior [master]

2018-03-20 Thread Nicolas Goaziou
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



Re: [O] Regression in #+include behavior [master]

2018-03-19 Thread Kaushal Modi
On Mon, Mar 19, 2018 at 6:52 PM Nicolas Goaziou 
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


Re: [O] Regression in #+include behavior [master]

2018-03-19 Thread Nicolas Goaziou
Hello,


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



Re: [O] Regression in #+include behavior [master]

2018-03-19 Thread Kaushal Modi
On Mon, Mar 19, 2018 at 4:00 PM Kaushal Modi  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