From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: buffer local org-src-preserve-indentation not respected Date: Sat, 03 Dec 2016 23:58:54 +0100 Message-ID: <87shq4bowh.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDJGh-0002g7-6x for emacs-orgmode@gnu.org; Sat, 03 Dec 2016 17:58:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDJGg-0005gX-AD for emacs-orgmode@gnu.org; Sat, 03 Dec 2016 17:58:55 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:56238) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cDJGg-0005fU-3h for emacs-orgmode@gnu.org; Sat, 03 Dec 2016 17:58:54 -0500 In-Reply-To: (David Dynerman's message of "Fri, 02 Dec 2016 13:59:00 -0800") 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" To: David Dynerman Cc: emacs-orgmode@gnu.org Hello, David Dynerman writes: > I'd like to report a bug. It seems that setting > org-src-preserve-indentation to true doesn't work if it's set buffer > local. > > To reproduce, save the following as an org file: > > #+BEGIN_SRC python :tangle preserve-indent.py > class Foo: > bar = 5 > #+END_SRC > > > Here is some interstitial text! > > #+BEGIN_SRC python :tangle preserve-indent.py > def __init__(self): > self.bar = 7 > #+END_SRC > > Then: > > 1) (setq org-src-preserve-indentation nil) and tangle the file. Open > preserve-indent.py and note that def __init__ has no leading whitespace, > which means python will not recognize it as a member of Foo > > 2) (setq org-src-preserve-indentation t) and tangle the file. Open > preserve-indent.py and note that now def __init__ is properly > indented. This is the expected behavior. > > 3) (setq org-src-perserve-indentation nil), then M-x > make-variable-buffer-local and set org-src-preserve-indentation to > t. Tangle the file and open preserve-indent.py. Note that def __init__ > is back to being not-indented. The expected behavior is that the > indentation would be respected, as in #2. Fixed. Thank you. Regards, -- Nicolas Goaziou