Open sebmiq opened 11 months ago
The issue is that org-transclusion-content-format-org
calls org-indent-region
, which, when org-src-tab-acts-natively
is t
, calls python-indent-region
, which indents as shown.
I'm not sure what part is wrong, but this can be fixed in org-transclusion-content-format-org
by setting org-src-tab-acts-natively
to nil
.
Thank you for the report and the investigation. I am not sure what the best way to support this within the code base. The source code notes this:
;; Fix indentation when `org-adapt-indentation' is non-nil org-transclusion-content-format-org
I don't think I can support every problem case, and this is my main reason to have the flexible mechanism to call org-transclusion-content-format-org
as an abnormal hook.
(defvar org-transclusion-content-format-functions
'(org-transclusion-content-format-org
org-transclusion-content-format))
My immediate suggestion for you is to either override the function org-transclusion-content-format-org
or define a custom function and set the variable org-transclusion-content-format-functions
so that your custom function gets called.
I will be in a vacation from the end of this week for five weeks or so; I will not be able to provide an immmediate fix. I trust that with your skill you will be able to implement your own solution for now.
I will need to come back to the issue of indentation at a later stage -- at the moment, I don't see a good way to support the Org-src's indentation behavior in every case... I will be very happy if you or anyone can find a good solution.
Thank you.
Hi,
I have an
in.org
file, whose content isand an
out.org
file, whose content isWhen I activate the transclusion, it shows
Note that the
i += 1
line had its indentation modified.