From mboxrd@z Thu Jan 1 00:00:00 1970 From: Noah Hoffman Subject: Re: left padding added each time a code block is edited Date: Fri, 8 Aug 2014 08:51:45 -0700 Message-ID: References: <87r40r9b42.fsf@gmail.com> <878umzytxr.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFmSf-0005F4-81 for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 11:52:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFmSc-0002VA-Ua for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 11:52:09 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:40778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFmSc-0002V0-Nu for emacs-orgmode@gnu.org; Fri, 08 Aug 2014 11:52:06 -0400 Received: by mail-wi0-f181.google.com with SMTP id bs8so1231982wib.14 for ; Fri, 08 Aug 2014 08:52:05 -0700 (PDT) In-Reply-To: <878umzytxr.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode On Fri, Aug 8, 2014 at 6:47 AM, Rasmus wrote: > Have you experienced any bugs with respect to this? On my system Babel > will even run this code correctly: > > #+BEGIN_SRC python > if True: > return( "hello!") > #+END_SRC > > #+RESULTS: > : hello! > > To use a slightly different example: #+BEGIN_SRC python import sys for i in range(10): print "foo" #+END_SRC -*- mode: compilation; default-directory: "~/Downloads/" -*- Compilation started at Fri Aug 8 08:44:39 ~/.emacs.d/bin/pychecker /Users/nhoffman/Downloads/broken.py /Users/nhoffman/Downloads/broken.py:1:2: unexpected indent import sys ^ /Users/nhoffman/Downloads/broken.py:1:3: E111 indentation is not a multiple of four /Users/nhoffman/Downloads/broken.py:1:3: E113 unexpected indentation /Users/nhoffman/Downloads/broken.py:2:3: E111 indentation is not a multiple of four /Users/nhoffman/Downloads/broken.py:3:7: E111 indentation is not a multiple of four Compilation finished at Fri Aug 8 08:44:40 Anything other than 4 spaces per indention level is flagged by python style/syntax checkers that enforce pep8 (and yes, many flame wars have been fought on the topic, but there are good reasons for enforcing consistency). This is an issue when editing code blocks and in tangled code. Maybe it's primarily an aesthetic thing, but I think that it's best when possible to set the default to follow the standard conventions for the language (my python mode certainly seems to think so!). >> 2. While this variable is very well documented, it isn't very >> discoverable via apropos or the html manual (at least, I wasn't able >> to discover it). Perhaps a reference can be added to this variable in >> the docstring for org-edit-src-code? > > Patches are more than welcome! There's a guide on Worg: > > http://orgmode.org/worg/org-contribute.html I'll do so with pleasure! Thanks again.