From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#32876: 26.1; python-mode mixes existing tabs with new spaces Date: Wed, 23 Jun 2021 16:38:45 +0200 Message-ID: <87v964k5my.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4967"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 32876@debbugs.gnu.org To: starback@stp.lingfil.uu.se (Per =?UTF-8?Q?Starb=C3=A4ck?=) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 23 16:41:02 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lw43p-00019V-LM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Jun 2021 16:41:01 +0200 Original-Received: from localhost ([::1]:60198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lw43o-00067G-MZ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Jun 2021 10:41:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lw41w-0002f0-St for bug-gnu-emacs@gnu.org; Wed, 23 Jun 2021 10:39:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lw41u-0006i2-NT for bug-gnu-emacs@gnu.org; Wed, 23 Jun 2021 10:39:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lw41u-00021B-Fd for bug-gnu-emacs@gnu.org; Wed, 23 Jun 2021 10:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Jun 2021 14:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32876 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 32876-submit@debbugs.gnu.org id=B32876.16244591377746 (code B ref 32876); Wed, 23 Jun 2021 14:39:02 +0000 Original-Received: (at 32876) by debbugs.gnu.org; 23 Jun 2021 14:38:57 +0000 Original-Received: from localhost ([127.0.0.1]:41653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw41p-00020s-6W for submit@debbugs.gnu.org; Wed, 23 Jun 2021 10:38:57 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:49504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lw41n-00020c-C4 for 32876@debbugs.gnu.org; Wed, 23 Jun 2021 10:38:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FLxlBP6dsR+lfzz8dT8iZ8/0WdsLlNV1oPq4cCkGZWE=; b=NUnTHWbK9jSXX6Rx/ts6fKaYvQ 1BRSrTEMm2ixSOuF7XOArQWyDdpnJM2/XBJu6Ug7cIg070SyThG+5zIOUwOlMrYlpQG+6j8v0nn9y 41wwRnYHs24Rj4+sTUgyC+kxIvAKtnk1uoelFWUrKO5iJ7LdmGLmOTa3T/8fnuEylQ60=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lw41e-0005z6-Eb; Wed, 23 Jun 2021 16:38:49 +0200 X-Now-Playing: The Clash's _Sandinista!_: "Junkie Slip" In-Reply-To: ("Per =?UTF-8?Q?Starb=C3=A4ck?="'s message of "Sat, 29 Sep 2018 18:13:30 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208903 Archived-At: starback@stp.lingfil.uu.se (Per Starb=C3=A4ck) writes: > I did "emacs -Q pytab.py" where pytab.py contains the two lines: > > ------------------------------ > def foo(): > print('hello') > ------------------------------ > > The second line begins with a TAB. > > Then I add a line to this marvellous program with > > M-> TAB print('world') C-x C-s > > This new line will have eight spaces in the beginning, and because of > that this is no longer a valid Python3 program! > > ### Background ### > > Earlier you could mix spaces and tabs (seen as 8 spaces) in Python, but > Python3 disallows mixing them. Andreas R=C3=B6hler writes: > python.el hard-codes > > (set (make-local-variable 'indent-tabs-mode) nil) > > which should be customizable. Well, I don't know -- the problem is that mixing them leads to invalid programs, so specifying a single tab mode here makes sense, since it will presumably lead to fewer problems in the long run. That is, python-mode doesn't really support .py files with tabs in them -- as a design decision. So I think this works as designed. Anybody else have an opinion here? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no