From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: src block indentation causing problems due to tab/space mixing - proposed fix Date: Sun, 19 Aug 2018 10:40:11 +0200 Message-ID: <87bm9ywxzo.fsf@nicolasgoaziou.fr> References: <87zhycu834.fsf@psi.ch> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frJFx-0008U5-Rr for emacs-orgmode@gnu.org; Sun, 19 Aug 2018 04:40:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1frJFt-0004A0-Qc for emacs-orgmode@gnu.org; Sun, 19 Aug 2018 04:40:17 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:53911) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1frJFt-00047B-IR for emacs-orgmode@gnu.org; Sun, 19 Aug 2018 04:40:13 -0400 In-Reply-To: <87zhycu834.fsf@psi.ch> (Derek Feichtinger's message of "Fri, 27 Jul 2018 15:22:23 +0200") 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: Derek Feichtinger Cc: emacs-orgmode@gnu.org Hello, Derek Feichtinger writes: > I think that the current way of indenting source blocks > (with org-src-preserve-indentation is set to nil) is not ideal in regard > to languages that dislike mixing of tabs and spaces. For such languages, there is `org-src-preserve-indentation'... > > I'm currently switching to python3 and this forbids the mixing. > Setting org-src-preserve-indentation to t would basically create > problems with many of my older files, You can set it locally, for every new Python block, with "-i" switch. > and I also dislike the reduced readability resulting from the code > block contents being aligned at column 0. I cannot see any other way around. > I just tested it also with some tangled files, and it seems to work > nicely for my test cases. Still, I may have overlooked something, and > there is a deeper reason for the original implementation. Org removes indentation automatically, e.g., when editing a source block or when exporting a document. If you indent lines in an indentation preserved block, there is no more way to tell if the indentation is added by Org -- and could be removed -- or required by the block. This is why we also need to indent them from column 0. Regards, -- Nicolas Goaziou