From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#32120: 26.1; In python.el tab-width should default to 4 Date: Fri, 29 Mar 2019 23:17:14 -0400 Message-ID: <87pnq9830l.fsf@gmail.com> References: <87d0vu3fxu.fsf@gmail.com> <87sh4qjevv.fsf@gmail.com> <0mo9fdvgf5.fsf@fencepost.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="22181"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) Cc: Robert Pluim , 32120@debbugs.gnu.org To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 30 04:37:50 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hA4oY-0005eR-6D for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Mar 2019 04:37:50 +0100 Original-Received: from localhost ([127.0.0.1]:50677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hA4oX-0000rG-7d for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Mar 2019 23:37:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hA4VS-0000Q5-SW for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 23:18:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hA4VQ-0003q7-Ur for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 23:18:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hA4VO-0003pS-8K for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 23:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hA4VN-0007SN-TW for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 23:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Mar 2019 03:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32120 X-GNU-PR-Package: emacs Original-Received: via spool by 32120-submit@debbugs.gnu.org id=B32120.155391584428619 (code B ref 32120); Sat, 30 Mar 2019 03:18:01 +0000 Original-Received: (at 32120) by debbugs.gnu.org; 30 Mar 2019 03:17:24 +0000 Original-Received: from localhost ([127.0.0.1]:36134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hA4Um-0007RX-07 for submit@debbugs.gnu.org; Fri, 29 Mar 2019 23:17:24 -0400 Original-Received: from mail-qt1-f171.google.com ([209.85.160.171]:34040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hA4Uk-0007RI-3p for 32120@debbugs.gnu.org; Fri, 29 Mar 2019 23:17:23 -0400 Original-Received: by mail-qt1-f171.google.com with SMTP id k2so4991163qtm.1 for <32120@debbugs.gnu.org>; Fri, 29 Mar 2019 20:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7koWH2rZvFR7tbz21lzX1KGFki02RPbR5UhpYk1tovM=; b=ImC4Hbi0mwzBTCS9ggYBeQSsQnMxsv3YUj5S8DqH7r6oDpgDW1PX5l9oy0S9CRnBLR PN/33Cur/Fv9A4BBnBNM2oHHmXmtwP7FZkHrFrlockA+B3lEWeVItl1IE0rcgAzjgbDM 4w6wMv+MR+Zyo67cyNnYHIylRqUeUvNivTxJ3Qhvqx8WMoNDJ0PQCD+Smk1xhuxkhlIk l9I96T9S38NCQlO+AOJW6o5MCw2NohTfMj31lzuqKBwNuGmTrng/3r0g0GASrTqhOYAu 5jvQIO4W+bGIP0dunb0ZrhDEqsmlZcFRisQp46GcpXV5gFIp0wnGEMZS3Ruas1+rAU5+ qHzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7koWH2rZvFR7tbz21lzX1KGFki02RPbR5UhpYk1tovM=; b=pU4AtzwsgIHi3SGgVnuGmav4Wx71fxMS6YP9+3ggB4f7nbz3SkOa/vpRW0DZU03yCm gFZ87iOzBUXsgC/4m+kN2Z0Y4xdXggNEu9hhtNd3EzQqw7K3qgAfDezUSvfb9cKN3tji cQdMXT7VXxa7njOvHjDZgYy98i2ZkxpqX83Y/V0xAxnoBGitFVYMYUUxJ/ZZhH21rCzh E1RCHGiaMvEjRvtTrCT3MfAsOfafavWiPraYDAdx1wz6pEtkirjR1/mGR9NvX15ICc7z 5TYjHpkT8g3mTNS98hNeKc3FrU3Ahg0AWcru12WrGLKtF5nrhiGmkEFCfXc2SkAo7rv4 dJ3g== X-Gm-Message-State: APjAAAW/tNysE+38v4pqcu8FYqZO/YeRHRDfytYrakmylK3djkGFEPUB lcbneWogNMNCeCsSondOO1s= X-Google-Smtp-Source: APXvYqycPDq27s7ld93Sm570xzL7pQ32c7gksYnGs3umV8Q4HMe82SZ0iGc1IdPSTGiIHKrYUBhgwQ== X-Received: by 2002:ac8:325c:: with SMTP id y28mr44768978qta.40.1553915836724; Fri, 29 Mar 2019 20:17:16 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id f29sm2419896qte.1.2019.03.29.20.17.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 20:17:15 -0700 (PDT) In-Reply-To: (Carlos Pita's message of "Wed, 11 Jul 2018 14:25:57 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156933 Archived-At: Carlos Pita writes: >> Right. What is your justification for wanting this to be 4? >> Python generally discourages tabs, but when they are present, seems to >> follow the historical convention mapping them to 8 spaces. >> https://docs.python.org/3/reference/lexical_analysis.html#indentation >> >> Tabs are replaced (from left to right) by one to eight spaces such >> that the total number of characters up to and including the >> replacement is a multiple of eight (this is intended to be the same >> rule as used by Unix). > Sure, I don't want to enter tab characters at all, I just want to > rigidly indent using 4-space tab stops. And setting tab-width to 4 and > indent-tabs-mode to nil makes C-x Tab S-Right do just that. > Some months later, I'm insisting on this. > > I don't see any point in setting the default to 8 when: > > 1. PEP 8 clearly states: use 4 spaces per indentation level. > 2. Python mode specific rigid indentation mechanism defaults to 4 spaces. > > AFAICS the only thing you get by setting tab-width to 8 is > incompatibility of emacs standard rigid indentation mechanism (M-x > Tab) with both 1 and 2. I think it's important to play well with > standard facilities (despite python mode providing it's own variant) > and, in any case, there is no good reason, no trade off, not to do it. Seems clear to me that the proper solution is simply to rebind C-x Tab S-left/right to use python-indent-shift-left/right. That will solve the actual problem you experience, without incorrectly showing any existing tab charaters as 4 spaces.