emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: [babel] [BUG] incorrect indentation when tangling with org


From: Antti Kaihola
Subject: [Orgmode] Re: [babel] [BUG] incorrect indentation when tangling with org-src-preserve-indentation
Date: Sat, 9 Oct 2010 15:22:03 +0300

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 <address@hidden>:
> 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.



reply via email to

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