From mboxrd@z Thu Jan 1 00:00:00 1970 From: Titus von der Malsburg Subject: Re: [BUG] in last org in indentation of source blocks Date: Thu, 28 May 2015 10:02:57 -0700 Message-ID: <87oal4y6ri.fsf@posteo.de> References: 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]:46803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yy1D6-0007Rs-CZ for emacs-orgmode@gnu.org; Thu, 28 May 2015 13:03:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yy1D0-0005Y7-Om for emacs-orgmode@gnu.org; Thu, 28 May 2015 13:03:12 -0400 Received: from mx02.posteo.de ([89.146.194.165]:54551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yy1D0-0005Y2-J3 for emacs-orgmode@gnu.org; Thu, 28 May 2015 13:03:06 -0400 In-reply-to: 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: Rainer M Krug Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 bug = that there is any indentation at all. 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVZ0pBAAoJEK40WfPGE2id4tUH/0/G7j0pKDn+0ZpUE40K5pJc Wv74e22ykUeBYchIkjud6hJTs6RH0J0QbNfyEzZl3rf0ufNCy78h3rk11vhC2402 Pg9i2/rfOfsVySW+7GWxWFTzdcV5s11YiVUWQ5CgFDHSOPgsQ6re67UrYFLJ5+Px dOQfKcDfNYtwepdskrkjc+lt7k6UPkHJljMo2yynGBeLosU6U0wUm8XEvbF6lNW0 VABpa/dmXVBcVh2Xbe6apwFeiVkkmV0qqYDsOybT6rJ4MPHwpYIlMew/Bk6Xw/mB 8ZCWNCewivOR3FQtRCobpoEIS4Fu4ylIDpD0CIbbCn1IOXlBsu9UmzHbz6HLWLY= =ptGK -----END PGP SIGNATURE----- --=-=-=--