Optionally prevent altering indentation of source code.
commitd1eacbcbe86b72b1f2112fdfa284b5207dcc4416
authorDan Davison <davison@stats.ox.ac.uk>
Thu, 8 Oct 2009 03:49:37 +0000 (7 23:49 -0400)
committerDan Davison <davison@stats.ox.ac.uk>
Thu, 8 Oct 2009 16:28:53 +0000 (8 12:28 -0400)
treed85ee867b429a2f98ed9e36bab86b36b11a9a676
parenta26640ef261af6a7dfa24ebb3e15154ac255de7d
Optionally prevent altering indentation of source code.

New customizable variable org-src-preserve-indentation, if non-nil,
prevents automatic removal of rectangular blocks of leading whitespace
in source code blocks. This is necessary when embedding python code in
an org file with a view to extracting all python blocks into a single
file (because whitespace indentation is critical in python code). The
changes in this commit also fix two bugs:

- Setting org-edit-src-content-indentation to zero resulted in an
  infinite loop in org-edit-src-exit.

- Fixed width regions are defined by lines starting with a colon, with
  optional leading whitespace. However, if there was any leading
  whitespace, org-edit-src-exit behaved incorrectly, causing the leading
  whitespace to grow.
lisp/org-src.el