emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] left padding added each time a code block is edited


From: Thorsten Jolitz
Subject: Re: [O] left padding added each time a code block is edited
Date: Fri, 08 Aug 2014 00:41:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Noah Hoffman <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]