From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: left padding added each time a code block is edited Date: Fri, 08 Aug 2014 00:41:01 +0200 Message-ID: <87r40r9b42.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFWNE-0004UH-6M for emacs-orgmode@gnu.org; Thu, 07 Aug 2014 18:41:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFWN6-0007wf-IT for emacs-orgmode@gnu.org; Thu, 07 Aug 2014 18:41:28 -0400 Received: from plane.gmane.org ([80.91.229.3]:54570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFWN6-0007wb-BS for emacs-orgmode@gnu.org; Thu, 07 Aug 2014 18:41:20 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XFWN2-00026A-JE for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 00:41:16 +0200 Received: from g231105104.adsl.alicedsl.de ([92.231.105.104]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Aug 2014 00:41:16 +0200 Received: from tjolitz by g231105104.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Aug 2014 00:41:16 +0200 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: emacs-orgmode@gnu.org Noah Hoffman writes: Hello, > Each time I edit a code block using =C-c '= (org-edit-special) and > then return to the org-mode buffer, two spaces are added to the left > margin of the code. For example, > > #+BEGIN_SRC python > print "hello" > #+END_SRC > > becomes > > #+BEGIN_SRC python > print "hello" > #+END_SRC > > after one round-trip. This is particularly problematic for python code > blocks since leading whitespace is meaningful. > > This is behavior that has been present in org-mode for so long that I > suspect that it's not a bug - but I'd love to know how to disable it. At the risk of being critizised by this mailing-list's QC department I give you this (unedited) hint: ,----[ C-h v org-edit-src-content-indentation RET ] | org-edit-src-content-indentation is a variable defined in `org-src.el'. | Its value is 2 | | Documentation: | Indentation for the content of a source code block. | This should be the number of spaces added to the indentation of the #+begin | line in order to compute the indentation of the block content after | editing it with M-x org-edit-src-code. Has no effect if | `org-src-preserve-indentation' is non-nil. `---- -- cheers, Thorsten