Org-transclusion: source losing indentation limitation

According to Org-transclusion User Manual:

Currently, the following extensions are available.

(off by default) org-transclusion-indent-mode

Support org-indent-mode. Known limitation: when transcluded, the source will temporarily lose the indentation. When the transclusion is removed, the source will regain the indentation.

@nobiot is this a fundamental constraint with how org-mode was constructed? OR, can we expect a workaround fix to this cosmetic issue soon? Currently, when the transclusion display is active, the transclusion source loses its indentation (see this picture: https://user-images.githubusercontent.com/63909884/150678953-db510ae6-0cbe-424c-ada2-c62e3b1adf7b.png โ€“ the right hand side is the transclusion source, and itโ€™s visible that the paragraph following the org headline has lost its visual indentation)


Hereโ€™s the org-transclusion-extensions value I am using:

org-transclusion-extensions is a variable defined in โ€˜org-transclusion.elโ€™.

Its value is
(org-transclusion-src-lines org-transclusion-font-lock
							org-transclusion-indent-mode)
Original value was 
(org-transclusion-src-lines org-transclusion-font-lock)

Extensions to be loaded with org-transclusion.el.

  You can customize this variable.

Bump. cc: @nobiot

Some anon claims to have a fix for this issue. See

@nobiot would you be interested in checking that?

The post mentions a PR. I would welcome this. One thing to note is that the fringe works only for GUI and not terminal if I remember correctly. I think the fringe solution would have to be an option. Alternatively, what I should do is to make the current way (line-wrap etc.) optional โ€” I thought I might have already done this. Need to check.

The post mentions a PR. I would welcome this.

There is an early PR now:

1 Like

Hello hello, PR author here.
Made an account, Iโ€™ve done considerable testing on this for both graphical interface and terminal (emacs -nw), on both doom emacs and vanilla emacs 30.2.

Let me know if thereโ€™s anything I can improve, or refactor if it doesnโ€™t conform to the standards.
Iโ€™ve made sure to make the indent-mode extension completely isolated as it was before, and the installation process is the exact same as before, no new dependencies or configuration steps.

Iโ€™ve also been looking at your transient branch to see if it would require further changes to adapt to it, org-transclusion-indent-mode.el isnโ€™t an issue, no problems there, but there are some conflicts on org-transclusion.el due to the payload and add functions changes which change the flow a bit, but otherwise the branches are pretty isolated from one another.

Thank you. Merged and left quick comments on GitHub repo :slight_smile:

Thank you. Merged and left quick comments on GitHub repo
:slight_smile:

Awesome. I will test this as soon as possible. In the meantime, when
do you think the following pull request [1] be ready to merge into the
main? I am currently on the feat/transient branch just because of this functionality.

Footnotes:
[1] Why can't org-transclusion use in-file targets? - #2 by nobiot

Thank you. Merged and left quick comments on GitHub repo

:slight_smile:

Awesome. I will test this as soon as possible.

I see @nobiot has merged the main into the feat/transient branch. Now I
could test the fix to the โ€œsource losing indentationโ€ annoyance. I see
that the fix is working, and the source org headings no longer lose
their visual indentation. Thanks nobiot. Thanks Gino.

Sorry this was a premature merge and my mistakeโ€ฆ apologies. I have since reset the main branch to where it was. I have some more to work on (clean up some code and documentation) but will merge the feature branch very soon. Hopefully this weekendโ€ฆ

But I think Ginoโ€™s fix should be already present in the main, is it not?

Thanks for quickly testing the merged one :slight_smile: I feel more confident that the functionality will work.

Sorry this was a premature merge and my mistakeโ€ฆ apologies. I have
since reset the main branch to where it was.
[โ€ฆ 4 lines elided]

But I said you merged โ€œmain into feat/transientโ€. It seems like you are
responding to a case thatโ€™s vice versa here. Am I understanding wrong?

But I think Ginoโ€™s fix should be already present in the main, is it
not?

I am still on feat/transient, but if you merge feat/transient INTO main,
then I will happily switch to main and enjoy both Ginoโ€™s contributions.

Thanks for quickly testing the merged one
:slight_smile:

Yeah, no worries. But as I said, I have tested the feat/transient
branch, after you merged main into feat/transient. I havenโ€™t tested
main in a long time, and definitely donโ€™t know whether you merged
feat/transient into main.

Again if I am understanding wrong which branch got merged into which, I
would be happy to correct my understanding.

I accidentally merged the feature branch into the main and quickly reset it :slight_smile:

Please stay in the feat/transient for now. I think itโ€™s almost ready. I have been pushing into it (just now too). I will be working on documentation with some help of Gemini (and I will ensure to revise it).

Please stay in the feat/transient for now. I think itโ€™s almost ready.
I have been pushing into it (just now too). I will be working on
documentation with some help of Gemini (and I will ensure to revise
it).

Howโ€™s the merge to the main coming along? Should I make the switch to
main?

Merry Christmas and Happy Holidays.

Merged :slight_smile: Happy festive season.

Merged
:slight_smile:
Happy festive season.

Switched to main. It works. Thanks for fixing the issue I outlined in
the OP of this thread.

1 Like