From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BUG] in last org in indentation of source blocks Date: Fri, 29 May 2015 09:45:10 +0200 Message-ID: References: <87oal4y6ri.fsf@posteo.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyEyj-0006KH-Hh for emacs-orgmode@gnu.org; Fri, 29 May 2015 03:45:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyEyg-0004V2-Bv for emacs-orgmode@gnu.org; Fri, 29 May 2015 03:45:17 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:35982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyEyg-0004Tv-3E for emacs-orgmode@gnu.org; Fri, 29 May 2015 03:45:14 -0400 Received: by wivl4 with SMTP id l4so8830783wiv.1 for ; Fri, 29 May 2015 00:45:13 -0700 (PDT) In-Reply-To: <87oal4y6ri.fsf@posteo.de> (Titus von der Malsburg's message of "Thu, 28 May 2015 10:02:57 -0700") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Titus von der Malsburg Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Titus von der Malsburg writes: > On 2015-05-28 Thu 04:49, Rainer M Krug wrote: >> I reralised this morning that there eems to be a bug introduced in one >> of the last commits which causes repeted editing of source blocks to >> indent more each time the are edited (C-'). >> >> Original: >> ,---- >> | #+begin_src sh >> | echo 2 >> | #+end_src >> `---- >> >> After C-' and back again >> ,---- >> | #+begin_src sh >> | echo 2 >> | #+end_src >> `---- >> >> After second C-' and back >> ,---- >> | #+begin_src sh >> | echo 2 >> | #+end_src >> `---- >> >> When C-', the indirect buffer has the same indentation as the source >> block, but when switching back, two more spaces are added. > > I can=E2=80=99t reproduce the second indent but I think it=E2=80=99s a bu= g that there is > any indentation at all. I just checked again, and the incremental indentation is there if I set ~org-src-preserve-indentation~ to non-nil. Rainer > > The documentation of `org-edit-special' (C-x ') says: > > Call a special editor for the element at point. =E2=80=A6 > > No mention of indentation or other reformatting of my code. > > The same goes for `org-edit-src-exit' (C-c C-c) which says: > > Kill current sub-editing buffer and return to source buffer. > > The edit-in-buffer feature should not touch the indentation. If the > syntax of the language is sensitive to indentation (e.g. Python) this > can break the code. Example: > > #+BEGIN_SRC python :results output > print "test" > #+END_SRC > > is invalid Python syntax. > > Also having one function perform two very different actions (edit code > in separate buffer *and* reformat the code) is poor design. At least in > this special case. When I open the code in a separate buffer but then > decide not to change it (C-c C-c), I'll end up with extra indentation > and this will create unnecessary changes when I commit the file in git. > > Titus > =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJVaBkGAAoJENvXNx4PUvmCCiQIAKoTMUg0DmZhR7PcnP2NjdYb OJIzCD8uSsuhBleYfeuCVV915I78sL1EG4ghzYBdbeKopi0FcKrxJR1SDXhI7Z4A nwYVH/DpJOXUfUq55uXyg+Jit3suJ0yuIPYrkBN/W3b8qfxX+yehjccUf6A9GnKd 1AJ9dpT/8MD7KSifmnXa8EGj0zyBP/XAtvdi8FlY7oY0CftZo8hZCoYAwX7wvaSE R1RcX0vwBG9zdMK5zjOF8qzBtgU87aHEXXlefm8bPd7Li+oGRWOnhD5sJXoUQSKo dvtvccrw6blJ+yGxCsv/VU7YtR+uT6qEcJYkag9/idlmad3eeNcLryO/kQsCk3o= =nvGG -----END PGP SIGNATURE----- --=-=-=--