From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Gray Subject: org-babel-tangle indentation Date: Thu, 08 Oct 2009 15:51:59 +0200 Message-ID: <86skduat8g.fsf@portan.ibr.cs.tu-bs.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvtR3-0005F0-Qp for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 09:53:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvtQz-0005BW-8C for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 09:53:37 -0400 Received: from [199.232.76.173] (port=58949 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvtQz-0005BL-5G for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 09:53:33 -0400 Received: from lo.gmane.org ([80.91.229.12]:43207) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MvtQy-0000UR-Nn for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 09:53:32 -0400 Received: from list by lo.gmane.org with local (Exim 4.50) id 1MvtQd-0001dQ-Pk for emacs-orgmode@gnu.org; Thu, 08 Oct 2009 15:53:11 +0200 Received: from portan.ibr.cs.tu-bs.de ([134.169.34.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Oct 2009 15:53:11 +0200 Received: from chrismgray by portan.ibr.cs.tu-bs.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Oct 2009 15:53:11 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, I've been using org-babel for a couple of weeks now and I really like it for programming. One thing I've noticed, though, is that source blocks are not indented when they are output by org-babel-tangle. This makes the output source hard to read, and incorrect for languages where indentation is important. For example, the following bit of python does not compile when tangled. --8<---------------cut here---------------start------------->8--- * Introduction This is some intro text. #+srcname: the first block #+begin_src python :tangle foo :exports none print '1 + 1' if 1 + 1 == 2: print 'oh no' else: # <> #+end_src Some more text. #+srcname: do the other thing #+begin_src python :tangle no :exports none print 'oh yes' #+end_src --8<---------------cut here---------------end--------------->8--- My preference would be for source blocks to be indented to the level of the comment that caused them to be inserted. Cheers, Chris