I am trying to edit a document using org mode. The document represents a blog post. I need the body of the post to be in markdown so I am using a src block.
The problem is that when I alter or save the text in the src block after opening it in another buffer using C-c '
, there is some type of automatic indention that is applied that messes up my formatting.
Here are the details.
Beginning with with a buffer that looks like this:
* title...
* body
#+begin_src markdown
Some text.
#+end_src
I press C-c '
and get a new buffer where I edit the markdown text to look like this in markdown mode:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
viverra nec consectetur ante hendrerit. Donec et mollis
dolor. Praesent et diam eget libero egestas mattis sit amet vitae
I used M-q
to format the text lines so there are newlines at the end of each line above. There are also no initial spaces.
Now if I either press C-x C-s
to save or C-c '
the formatting above is changed to look like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
viverra nec consectetur ante hendrerit. Donec et mollis
dolor. Praesent et diam eget libero egestas mattis sit amet vitae
Every other line is indented two spaces.
I have tried this with other src types, such as using:
#+begin_src javascript
I get similar indentation, though it doesn't alternate. Two spaces are added to every line, instead.
I am assuming that this isn't a bug but my Internet searches and looks through the documentation haven't turned up the answer.
I'm using GNU Emacs 23.4.1 on Arch Linux with Org-mode 6.33x.
I also tried using the latest version of org-mode from git 7.8.05.