The following changes fix the indenting problem for first lines of source code blocks but introduces extra blank lines:
diff --git a/lisp/ob-python.el b/lisp/ob-python.el index c172756..27936e8 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -58,3 +58,3 @@ (nth 1 (or processed-params (org-babel-process-params params))) "\n") - "\n" (org-babel-trim body) "\n")) + "\n" body "\n")) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index a9429c4..ba6387a 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -365,3 +365,3 @@ form (insert (format "%s\n" (replace-regexp-in-string - "^," "" (org-babel-trim body)))) + "^," "" body))) (when link-p 2010/10/9 Antti Kaihola <akaih...@gmail.com>: > As pointed out in the documentation, when tangling Python code, it's > important to set org-src-preserve-indentation to a non-nil value. > However, tangling still doesn't seem to work correcly: If the first > line of a source code block is indented, it ends up dedented to the > first column in the resulting .py file. _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode