From unknown Tue Aug 19 10:00:13 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12822 <12822@debbugs.gnu.org> To: bug#12822 <12822@debbugs.gnu.org> Subject: Status: python.el, python-indent-guess-indent-offset Reply-To: bug#12822 <12822@debbugs.gnu.org> Date: Tue, 19 Aug 2025 17:00:13 +0000 retitle 12822 python.el, python-indent-guess-indent-offset reassign 12822 emacs submitter 12822 Andreas R=C3=B6hler severity 12822 minor tag 12822 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 07 06:05:47 2012 Received: (at submit) by debbugs.gnu.org; 7 Nov 2012 11:05:47 +0000 Received: from localhost ([127.0.0.1]:53493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TW3S6-0004RV-Rj for submit@debbugs.gnu.org; Wed, 07 Nov 2012 06:05:47 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60489) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TW3S4-0004RO-KC for submit@debbugs.gnu.org; Wed, 07 Nov 2012 06:05:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TW3Rz-0002OW-HG for submit@debbugs.gnu.org; Wed, 07 Nov 2012 06:05:48 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:45370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TW3Rz-0002OQ-DV for submit@debbugs.gnu.org; Wed, 07 Nov 2012 06:05:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TW3Rt-0006pS-PL for bug-gnu-emacs@gnu.org; Wed, 07 Nov 2012 06:05:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TW3Rk-0002L5-BE for bug-gnu-emacs@gnu.org; Wed, 07 Nov 2012 06:05:33 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:58971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TW3Rk-0002Kk-0z for bug-gnu-emacs@gnu.org; Wed, 07 Nov 2012 06:05:24 -0500 Received: from [192.168.178.27] (brln-4d0c0ee0.pool.mediaWays.net [77.12.14.224]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MNO13-1TPkz2298L-006vwH; Wed, 07 Nov 2012 12:05:22 +0100 Message-ID: <509A4069.5060409@easy-emacs.de> Date: Wed, 07 Nov 2012 12:05:13 +0100 From: =?ISO-8859-15?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: python.el, python-indent-guess-indent-offset Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:bnuTDTd+fCm9eefoQ+apjnwTxTOGR2fZ6YXT9WxlORx NVv/HIYw4QAPNZnPX+7HtA1U2GPlWxgsVLIzIkSY8lWbUEDkbx m0nhPVvsnP58JjZD3oiA7T4pYbVUE3tcxXLUBr+fQEi0Dwnuzk qSqiFIa2Bljsuk7R9omN9T3wtIUKIKK4awXEwNd8LCtquLwK7R /2dRNpuYx92B2dX3fjDcdMjppd685GFXYdQor67f0i2r/ocxY1 W4gvNXlI2mOaG6Ic37Vy0cNv9mtaC0L+DaGJ5eQdZthfRm+yCW Mym2D6O2+EliGObXakczN7YiQnK6VlCl7KB8fa9vecNBlwq5fI Ux7CZkKrkKAIuF544LREVIlcrNLJwVrnXOkY4GT8X X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hi, with current python.el python-indent-guess-indent-offset proceeds: (defun python-indent-guess-indent-offset () "Guess and set `python-indent-offset' for the current buffer." (interactive) (save-excursion (save-restriction (widen) (goto-char (point-min)) (let ((block-end)) (while (and (not block-end) (re-search-forward (python-rx line-start block-start) nil t)) [...] IIUC it fetches the first beginning of block in buffer. As in Python every block might have it's own ideas WRT volume of indent-step, this must fail when indent-offset is set differently in current block. Guessing must not take the first block from BOB, but the next beginning of block from point upward. IMO as it's just a guess, where the default-value might be delivered, it also should not call `widen'. Best, Andreas From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 20:40:51 2013 Received: (at 12822) by debbugs.gnu.org; 24 Jan 2013 01:40:51 +0000 Received: from localhost ([127.0.0.1]:47007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyBoA-0008JT-PC for submit@debbugs.gnu.org; Wed, 23 Jan 2013 20:40:51 -0500 Received: from mail-gg0-f179.google.com ([209.85.161.179]:42591) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyBo4-0008JE-Hf for 12822@debbugs.gnu.org; Wed, 23 Jan 2013 20:40:46 -0500 Received: by mail-gg0-f179.google.com with SMTP id h4so587850ggn.24 for <12822@debbugs.gnu.org>; Wed, 23 Jan 2013 17:39:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to :content-type:content-transfer-encoding:x-gm-message-state; bh=fNfNeMICBgUVokx/i2vDgGU0esbhMqDlW7UCsACu7t4=; b=ltXAjowQ3tNRiT6+AbE8eFJzdbmPYHxzge0BsTeJTw1poZezW4VgiH4APFpTPwuKow p1Qr8ReMRuAnR+/x+fRs1DOY8gxWNy2VNjpviFR36dKHyi/axbgQsrvLgP75FTzIp/hb qiF1f16ruv9+qgyimZKZo2C4rc/TxgeHWgL9tottB/g4eU7t1PAVtnykml2o99rCx9x3 D8ihRkBsEBGHc5gl6/mN4eArsWiusKfidqcH79hH0hZM6VMz0Drhx387ECBXjX/X0jnP YEo/EsWS5VEY61waZ9tLoR3JCY4OzVn2inSd49PkDW4tD5YEALHipnRHWFfzTwNDX6F5 wgvA== X-Received: by 10.236.134.163 with SMTP id s23mr249574yhi.54.1358991565206; Wed, 23 Jan 2013 17:39:25 -0800 (PST) Received: from [192.168.1.102] ([190.192.49.157]) by mx.google.com with ESMTPS id a43sm21934069yhl.0.2013.01.23.17.39.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 17:39:24 -0800 (PST) Message-ID: <5100911D.1000500@anue.biz> Date: Wed, 23 Jan 2013 22:40:45 -0300 From: =?ISO-8859-1?Q?Fabi=E1n_Ezequiel_Gallina?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 MIME-Version: 1.0 To: 12822@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkka7jxJt3gQoMhJmCMK8XC8vblu31p0H7ily+1KbKXws5dzU7DeW4OFcfn2MwDH+XQFDLP X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The whole idea of python-indent-guess-indent-offset is to provide some sane default at find-file. The decision of making the indentation of first available block the default indentation is intended and it's not going to change. This way indentation guessing behaves consistently all the time and the user is able to modify the first block so the command plays nice to him after next file visit. [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.161.179 listed in list.dnswl.org] 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.5000] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: 12822 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The whole idea of python-indent-guess-indent-offset is to provide some sane default at find-file. The decision of making the indentation of first available block the default indentation is intended and it's not going to change. This way indentation guessing behaves consistently all the time and the user is able to modify the first block so the command plays nice to him after next file visit. [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.161.179 listed in list.dnswl.org] 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4795] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject The whole idea of python-indent-guess-indent-offset is to provide some sane default at find-file. The decision of making the indentation of first available block the default indentation is intended and it's not going to change. This way indentation guessing behaves consistently all the time and the user is able to modify the first block so the command plays nice to him after next file visit. Also, as a side note, all blocks in a python file should be indented the same way, the only special case would be an if triggered into multiple lines using parens like this but this case is not that common that I'm not even worrying about: if (something and somethingelse and otherstuff): pass From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 23 20:44:05 2013 Received: (at control) by debbugs.gnu.org; 24 Jan 2013 01:44:05 +0000 Received: from localhost ([127.0.0.1]:47012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyBrJ-0008OW-Ar for submit@debbugs.gnu.org; Wed, 23 Jan 2013 20:44:05 -0500 Received: from mail-gh0-f180.google.com ([209.85.160.180]:42632) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TyBrH-0008OQ-O0 for control@debbugs.gnu.org; Wed, 23 Jan 2013 20:44:03 -0500 Received: by mail-gh0-f180.google.com with SMTP id f13so1171368ghb.39 for ; Wed, 23 Jan 2013 17:42:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to :content-type:content-transfer-encoding:x-gm-message-state; bh=RwmeZB9eZTNWu1RXzsYTC15avkNwN/TtjRr3azanBJI=; b=IqRDS1q3R063TKezJAqWtuQ1CqzSsX8RGQ1gG1GpkzGGD8Ky8Q9p14obRGaM3+5CwE 9KgOCOQ+BQSbIWYf0RscnzZjexC1Qu1Jzo+uGGHAZsCMbgpoq4qjqMSOq0IGQ/IS6ISc jmh0VaQf3y/6PqQnb9VXnslvYjkb7SBpowqR9Rcvv6hgdQ0YjTgd35cXvNy72B39PgFj Weu9/xlJbrCHcoFiJV9A4gLSezKMT4eROS5zoxT/MGYHXTbE3ut5+7zzzPRoCTAx21tD 1OBmGh9RyQWWq3Slv1I4afS8YAzewGUeDrlyc0JMIrOet2DvEE8oJT7KNi2WSukElGZp PrMQ== X-Received: by 10.100.250.8 with SMTP id x8mr84759anh.11.1358991765625; Wed, 23 Jan 2013 17:42:45 -0800 (PST) Received: from [192.168.1.102] ([190.192.49.157]) by mx.google.com with ESMTPS id c44sm2498488yhl.15.2013.01.23.17.42.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 17:42:44 -0800 (PST) Message-ID: <510091E6.20705@anue.biz> Date: Wed, 23 Jan 2013 22:44:06 -0300 From: =?ISO-8859-1?Q?Fabi=E1n_Ezequiel_Gallina?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2 MIME-Version: 1.0 To: control@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmD9yPKyQlZgqMersRo8XR96uQOyrJ/wfhnNfK2SOMWX6PTcDjaqdyVGBnaabpmu/HJhVT2 X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 12822 wontfix close 12822 [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.180 listed in list.dnswl.org] 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4991] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 12822 wontfix close 12822 [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.180 listed in list.dnswl.org] -0.0 BAYES_40 BODY: Bayes spam probability is 20 to 40% [score: 0.2806] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject tags 12822 wontfix close 12822 From unknown Tue Aug 19 10:00:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 21 Feb 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator