From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: Python src blocks indent Date: Wed, 17 May 2017 22:49:07 +0200 Message-ID: References: <87mvabr7lj.fsf@nicolasgoaziou.fr> <87a86br5qk.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c05f7589803dd054fbe6cf8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB5sv-0001Wr-Rh for emacs-orgmode@gnu.org; Wed, 17 May 2017 16:49:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dB5su-0001mh-Rf for emacs-orgmode@gnu.org; Wed, 17 May 2017 16:49:29 -0400 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:36601) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dB5su-0001mM-N1 for emacs-orgmode@gnu.org; Wed, 17 May 2017 16:49:28 -0400 Received: by mail-qk0-x22f.google.com with SMTP id u75so20682329qka.3 for ; Wed, 17 May 2017 13:49:28 -0700 (PDT) In-Reply-To: <87a86br5qk.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" --94eb2c05f7589803dd054fbe6cf8 Content-Type: text/plain; charset="UTF-8" Thanks Nicolas. I should have looked closer at ox-ipynb since the problem is in there. It should make use of `org-export-unravel-code' and it doesn't. Instead it trims leading white spaces from the src code. I'll report it to the scimax github repository. Best regards, 2017-05-17 15:08 GMT+02:00 Nicolas Goaziou : > Fabrice Popineau writes: > > > I mean that in the Org buffer I have for example : > > > > #+BEGIN_SRC ipython :session > > def fact(n): > > if n == 1: > > return 1 > > else: > > return n * fact(n-1) > > #+END_SRC > > > > That is, there is a 2 spaces indentation of the whole code block, and the > > code block is properly indented. > > When I export it, I get : > > > > def fact(n): > > if n == 1: > > return 1 > > else: > > return n * fact(n-1) > > FWIW I cannot reproduce it. You may want to debug > `org-export-unravel-code', `org-export-format-code' or > `org-export-format-code-default'. > > Regards, > --94eb2c05f7589803dd054fbe6cf8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Nicolas.

I should have looked cl= oser at ox-ipynb since the problem is in there.
It should make us= e of =C2=A0`org-export-unravel-code&#= 39; and it doesn't. Instead
it trims leading white spaces from the src code.
I&= #39;ll report it to the scimax github repository.

= Best regards,

2017-05-17 15:08 GMT+02:00 Nicolas Goaziou <mail@nicolasgoazi= ou.fr>:
Fa= brice Popineau <fabrice.po= pineau@gmail.com> writes:

> I mean that in the Org buffer I have for example :
>
> #+BEGIN_SRC ipython :session
>=C2=A0 =C2=A0def fact(n):
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if n =3D=3D 1:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0else:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return n * fact(n-1)
> #+END_SRC
>
> That is, there is a 2 spaces indentation of the whole code block, and = the
> code block is properly indented.
> When I export it, I get :
>
> def fact(n):
>=C2=A0 =C2=A0 =C2=A0 =C2=A0if n =3D=3D 1:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0else:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return n * fact(n-1)

FWIW I cannot reproduce it. You may want to debug
`org-export-unravel-code', `org-export-format-code' or
`org-export-format-code-default'.

Regards,

--94eb2c05f7589803dd054fbe6cf8--