From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiajian Huang Subject: Re: Bug: org-edit-special does not indent the blank line after exit editing [9.0.3 (9.0.3-elpa @ /Users/Yomisuko/.emacs.d/elpa/org-20161224/)] Date: Sat, 7 Jan 2017 15:09:38 +0800 Message-ID: References: <878tqo176n.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045e40644feebe05457bd104 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPl8G-0006dB-E2 for emacs-orgmode@gnu.org; Sat, 07 Jan 2017 02:09:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPl8F-00089i-9U for emacs-orgmode@gnu.org; Sat, 07 Jan 2017 02:09:40 -0500 Received: from mail-ua0-x231.google.com ([2607:f8b0:400c:c08::231]:33079) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cPl8F-00089Z-3g for emacs-orgmode@gnu.org; Sat, 07 Jan 2017 02:09:39 -0500 Received: by mail-ua0-x231.google.com with SMTP id i68so320392252uad.0 for ; Fri, 06 Jan 2017 23:09:39 -0800 (PST) In-Reply-To: <878tqo176n.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 --f403045e40644feebe05457bd104 Content-Type: text/plain; charset=UTF-8 Hi, Thanks for you reply. I cannot understand the design of `org-src-preserve-indentation`. Setting it to `nil` cause what described in my previous mail. Setting it to `t` lose the leading two spaces indentation/alignment in the origin org buffer. If it is `nil`, why inserting 2 leading spaces to the code in the org buffer except the line containing only spaces? How can I get #+BEGIN_SRC python a = 1 b = 2 for i in range(10): # 6 spaces before '#' #+END_SRC after exit `org-edit-special` ? Best regards, Jiajian Huang On Sat, Jan 7, 2017 at 12:31 AM, Nicolas Goaziou wrote: > Hello, > > Jiajian Huang writes: > > > Reproduce steps: > > > > Launch emacs by `emacs -Q`, eval the following snippet(assumed org 9.x > > is installed via elpa) > > > > (package-initialize) > > (require 'org) > > > > open a org buffer, input the source by > > > #+BEGIN_SRC python > > > > #+END_SRC > > > > use C-c ' to edit the block and input > > > > for i in range(10): # input this line and > > # there are 4 spaces before the '#' now > > > > use C-c ' to close the source block buffer and back to org-mode, we can > > see the first line of the block is indented 2 spaces by org while the > blank > > line > > isn't. > > This is not a bug. See `org-src-preserve-indentation'. > > Regards, > > -- > Nicolas Goaziou > --f403045e40644feebe05457bd104 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

Thanks for you reply. I cannot unde= rstand the design of `org-src-preserve-indentation`.=C2=A0

Setting it to `nil` cause what described in my previous mail.=C2= =A0
Setting it to `t` lose the leading two spaces indentation/ali= gnment in the origin org buffer.=C2=A0

If it is `n= il`, why inserting 2 leading spaces to the code in the org buffer except th= e line containing only spaces?

How can I get=C2=A0=

#+BEGIN_SRC python
=C2=A0 =C2=A0 a =3D = 1
=C2=A0 =C2=A0 b =3D 2
=C2=A0 =C2=A0 for i in range(10= ):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 # 6 spaces before '#'
#+END_SRC

after exit `org-edit-special` ?

Best regards,
Jiajian Huang


--f403045e40644feebe05457bd104--