You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Crible d’Ératosthène
#+BEGIN_SRC python
def crible(n):
l = [True] * (n+1)
l[0], l[1] = False, False
i = 2
while i*i <= n:
if l[i]:
k = 2
while i*k <= n:
l[i*k] = False
k += 1
i += 1
return l
#+END_SRC
* Crible d’Ératosthène
#+begin_src python
def crible(n):
l = [True] * (n+1)
l[0], l[1] = False, False
i = 2
while i*i <= n:
if l[i]:
k = 2
while i*k <= n:
l[i*k] = False
k += 1
i += 1
return l
#+end_src
Note that the i += 1 line had its indentation modified.
The text was updated successfully, but these errors were encountered:
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.
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.
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.The text was updated successfully, but these errors were encountered: