From unknown Fri Jun 20 19:48:26 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#18228 <18228@debbugs.gnu.org> To: bug#18228 <18228@debbugs.gnu.org> Subject: Status: 24.4.50; electrict-indent-mode bad indentation in python-mode Reply-To: bug#18228 <18228@debbugs.gnu.org> Date: Sat, 21 Jun 2025 02:48:26 +0000 retitle 18228 24.4.50; electrict-indent-mode bad indentation in python-mode reassign 18228 emacs submitter 18228 Jorgen Schaefer severity 18228 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 09 06:01:06 2014 Received: (at submit) by debbugs.gnu.org; 9 Aug 2014 10:01:07 +0000 Received: from localhost ([127.0.0.1]:36081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XG3SU-0001QV-DN for submit@debbugs.gnu.org; Sat, 09 Aug 2014 06:01:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44250) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XG3SP-0001Ps-Sm for submit@debbugs.gnu.org; Sat, 09 Aug 2014 06:01:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XG3SE-0006UT-K5 for submit@debbugs.gnu.org; Sat, 09 Aug 2014 06:00:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XG3SE-0006UP-GU for submit@debbugs.gnu.org; Sat, 09 Aug 2014 06:00:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XG3S9-0003gr-7u for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 06:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XG3S3-0006Sl-VZ for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 06:00:45 -0400 Received: from loki.jorgenschaefer.de ([87.230.15.51]:43298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XG3S3-0006SV-PM for bug-gnu-emacs@gnu.org; Sat, 09 Aug 2014 06:00:39 -0400 Received: by loki.jorgenschaefer.de (Postfix, from userid 1000) id B0E45201315; Sat, 9 Aug 2014 12:00:07 +0200 (CEST) From: Jorgen Schaefer To: bug-gnu-emacs@gnu.org Subject: 24.4.50; electrict-indent-mode bad indentation in python-mode Date: Sat, 09 Aug 2014 12:00:07 +0200 Message-ID: <87egwqgezc.fsf@loki.jorgenschaefer.de> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi! With a freshly compiled Emacs (git ref 3fc84165), I get the following behavior. In a Python buffer with electric-indent-mode enabled, enter this: def foo(): print "Foo" def bar() Adding a colon (":"") at the end of bar() will then indent the line to the same indentation level as the "print" statement. While this is the default indentation level for RET after the print statement, I would expect that the colon will not reindent my current line. python-mode can not know which indentation level is correct, so it should not insist on one. In GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu) of 2014-08-09 on loki.jorgenschaefer.de System Description: Debian GNU/Linux 7.6 (wheezy) Configured using: `configure --without-x' Configured features: SOUND NOTIFY LIBXML2 ZLIB Important settings: value of $LC_ALL: value of $LC_COLLATE: de_DE.UTF-8 value of $LC_CTYPE: de_DE.UTF-8 value of $LC_MESSAGES: POSIX value of $LC_MONETARY: POSIX value of $LC_NUMERIC: POSIX value of $LC_TIME: POSIX value of $LANG: POSIX locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: gitty-mode: t flx-ido-mode: t yas-minor-mode: t flymake-mode: t eldoc-mode: t company-mode: t elpy-mode: t pyvenv-mode: t circe-lagmon-mode: t tracking-mode: t shell-dirtrack-mode: t winner-mode: t display-time-mode: t global-subword-mode: t subword-mode: t show-paren-mode: t ido-everywhere: t electric-pair-mode: t delete-selection-mode: t cua-mode: t tooltip-mode: t electric-indent-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t auto-fill-function: do-auto-fill From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 03:12:07 2014 Received: (at submit) by debbugs.gnu.org; 11 Aug 2014 07:12:07 +0000 Received: from localhost ([127.0.0.1]:38393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGjm2-0000T8-WA for submit@debbugs.gnu.org; Mon, 11 Aug 2014 03:12:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54775) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGjm0-0000Sc-52 for submit@debbugs.gnu.org; Mon, 11 Aug 2014 03:12:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGjll-00044o-1L for submit@debbugs.gnu.org; Mon, 11 Aug 2014 03:11:58 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGjlk-00044j-UG for submit@debbugs.gnu.org; Mon, 11 Aug 2014 03:11:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGjld-0002Cj-2m for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2014 03:11:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGjlV-00042U-Jf for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2014 03:11:41 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:55256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGjlV-00042O-Am for bug-gnu-emacs@gnu.org; Mon, 11 Aug 2014 03:11:33 -0400 Received: from [192.168.178.32] (brln-4dba2a96.pool.mediaWays.net [77.186.42.150]) by mrelayeu.kundenserver.de (node=mreue004) with ESMTP (Nemesis) id 0MFwx8-1XDy4b2XmY-00ExfA; Mon, 11 Aug 2014 09:11:31 +0200 Message-ID: <53E86C87.4080007@easy-emacs.de> Date: Mon, 11 Aug 2014 09:11:03 +0200 From: =?ISO-8859-1?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.7.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode References: <87egwqgezc.fsf@loki.jorgenschaefer.de> In-Reply-To: <87egwqgezc.fsf@loki.jorgenschaefer.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:BWIdE+fK5B8yQO5zI0DIVwTlNl2qxNd4pygJBn9AW8d M1rNIzIfHeX7ImESZBn5+mPC7Ew1J37T4gXD7jJn3ySiqrHAvY khgDZkwmg02w4cwA80yd4yVwNFy6oj7A8gTakAIxm0rZKmRgpW G2dasEgW06ceDOP+YOq/FhTLhj0c4fJmON3jz1WjGGD7FlJcnH 8Tpsz31Su3TIUJeklRu5jP7cZQnm3l8iQL6GpXyFui6yTl6zXy 0IWiq0odGiEi2Qf/q59UnqwBb2Nwlr1p9ZhPZPHMTXyDmy9tVO Nv+CBBOrEJzJNai4lGORQVbeC06cV4aRnx50nm4AJx5RkDTSfW uqY3c1XWZ/JBA9tJxO/zIDZNsab9p9ciqbDYjntwe X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) On 09.08.2014 12:00, Jorgen Schaefer wrote: > Hi! > With a freshly compiled Emacs (git ref 3fc84165), I get the following > behavior. In a Python buffer with electric-indent-mode enabled, enter > this: > > > def foo(): > print "Foo" > > def bar() > > > Adding a colon (":"") at the end of bar() will then indent the line to > the same indentation level as the "print" statement. > > While this is the default indentation level for RET after the print > statement, I would expect that the colon will not reindent my current > line. python-mode can not know which indentation level is correct, Right. But what should electric-indent do than? IMO the only reasonable is indenting to outmost permitted. Which seems the case. Electric behaviour seems not that useful in Python than with other modes. AFAICS not a bug. Best, Andreas From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 10:45:31 2014 Received: (at 18228) by debbugs.gnu.org; 11 Aug 2014 14:45:31 +0000 Received: from localhost ([127.0.0.1]:39466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGqqo-00053G-24 for submit@debbugs.gnu.org; Mon, 11 Aug 2014 10:45:30 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:27601) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGqql-000532-9W for 18228@debbugs.gnu.org; Mon, 11 Aug 2014 10:45:28 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVPAqyKr/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKsDg0wh X-IPAS-Result: ArYGAIDvNVPAqyKr/2dsb2JhbABZgwaDSr0vgw6BFxd0giUBAQEBAgFWIwULCzQSFBgNJIgECNIZF456B4Q4BKsDg0wh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="85458654" Received: from 192-171-34-171.cpe.pppoe.ca (HELO pastel.home) ([192.171.34.171]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Aug 2014 10:45:21 -0400 Received: by pastel.home (Postfix, from userid 20848) id 9088B60498; Mon, 11 Aug 2014 10:45:21 -0400 (EDT) From: Stefan Monnier To: Andreas =?windows-1252?Q?R=F6hler?= Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode Message-ID: References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> Date: Mon, 11 Aug 2014 10:45:21 -0400 In-Reply-To: <53E86C87.4080007@easy-emacs.de> ("Andreas =?windows-1252?Q?R?= =?windows-1252?Q?=F6hler=22's?= message of "Mon, 11 Aug 2014 09:11:03 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18228 Cc: 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > But what should electric-indent do than? No re-indent upon : when it's not 100% sure of the result. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 13:19:23 2014 Received: (at 18228) by debbugs.gnu.org; 11 Aug 2014 17:19:23 +0000 Received: from localhost ([127.0.0.1]:39601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGtFi-0001fa-Q1 for submit@debbugs.gnu.org; Mon, 11 Aug 2014 13:19:23 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:65359) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGtFg-0001fM-0g for 18228@debbugs.gnu.org; Mon, 11 Aug 2014 13:19:20 -0400 Received: from [192.168.178.32] (brln-4dba2a96.pool.mediaWays.net [77.186.42.150]) by mrelayeu.kundenserver.de (node=mreue004) with ESMTP (Nemesis) id 0M2YjJ-1WRGZI11Jl-00sLcA; Mon, 11 Aug 2014 19:19:13 +0200 Message-ID: <53E8FAFA.9060902@easy-emacs.de> Date: Mon, 11 Aug 2014 19:18:50 +0200 From: =?ISO-8859-1?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.7.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:JaLiUz/9VS08zpF0ku+GML2XitgzQBfAJt2GVwJiWhn UO/+vqxbQo4AGlDonWES4ZoTTHLTmxHkjcqd3uLBXg2+zB91Zh +pHHvGjvEqJavhp3V1U/tj6vn6181PAMOTMxdJ+McKst1+OuP/ 4c5ycGAnSB8YGADv8ukgpcH5uIw+YjTo8BDBdNWW3Cskl/kqkv noGv2JhMNe7ddr29MOIsjLxK4XDHCyEJ2+50pBFCVP4DvHPDvm K1lr4/Z9esk1eQzPmIhhYxKMYyA41le5LxLs0NHYc08ARjFDRt qZAT4+1sJQnsbjBIQtSKu44QT2QT1Phho6mC9vxMUqf23kHBpq DxrgnGQM5s5mFqvJayuMsahItsM953Pp+Z2oblZs7 X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18228 Cc: 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 11.08.2014 16:45, Stefan Monnier wrote: >> But what should electric-indent do than? > > No re-indent upon : when it's not 100% sure of the result. > Which sums up to switch it off. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 11 22:41:00 2014 Received: (at 18228) by debbugs.gnu.org; 12 Aug 2014 02:41:00 +0000 Received: from localhost ([127.0.0.1]:39813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XH21D-0000AR-BX for submit@debbugs.gnu.org; Mon, 11 Aug 2014 22:40:59 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:35778) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XH219-0000AF-On for 18228@debbugs.gnu.org; Mon, 11 Aug 2014 22:40:56 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s7C2er2q004189; Mon, 11 Aug 2014 22:40:53 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 95B36AE79E; Mon, 11 Aug 2014 22:40:52 -0400 (EDT) From: Stefan Monnier To: Andreas =?windows-1252?Q?R=F6hler?= Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode Message-ID: References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> <53E8FAFA.9060902@easy-emacs.de> Date: Mon, 11 Aug 2014 22:40:52 -0400 In-Reply-To: <53E8FAFA.9060902@easy-emacs.de> ("Andreas =?windows-1252?Q?R?= =?windows-1252?Q?=F6hler=22's?= message of "Mon, 11 Aug 2014 19:18:50 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5031=0 X-NAI-Spam-Version: 2.3.0.9378 : core <5031> : inlines <1165> : streams <1261069> : uri <1801653> X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 18228 Cc: "=?windows-1252?Q?Fabi=E1n?= E. Gallina" , 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) >>> But what should electric-indent do than? >> No re-indent upon : when it's not 100% sure of the result. > Which sums up to switch it off. Not to switch off electric-indent, no (it's enabled globally). And presumably the : was made to re-indent because in some/many cases there is only 1 correct indentation (and the code is able to find it). I don't know if the code is also able to detect when it's correct and when it's not, but if it is, then we don't need to disable the "reindent on :" in all cases. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 03:06:28 2014 Received: (at 18228) by debbugs.gnu.org; 12 Aug 2014 07:06:28 +0000 Received: from localhost ([127.0.0.1]:40027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XH6A7-0004wD-Dn for submit@debbugs.gnu.org; Tue, 12 Aug 2014 03:06:27 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:63366) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XH6A4-0004vz-Tm for 18228@debbugs.gnu.org; Tue, 12 Aug 2014 03:06:25 -0400 Received: from [192.168.178.32] (brln-4d0c7ed9.pool.mediaWays.net [77.12.126.217]) by mrelayeu.kundenserver.de (node=mreue102) with ESMTP (Nemesis) id 0ML81x-1XGpB23uoT-000OyV; Tue, 12 Aug 2014 09:06:18 +0200 Message-ID: <53E9BCCB.5020304@easy-emacs.de> Date: Tue, 12 Aug 2014 09:05:47 +0200 From: =?ISO-8859-1?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.7.0 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> <53E8FAFA.9060902@easy-emacs.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:Gm0pZMqXXeL9su8ZkT+eCOMuKSamTAwM+FZO7PPhmcq aQKwnQeZezB88BB6liiZEpqJ1o/tv12LSWU0QFM4o8cjbA49Wr NvZdxHRwV2jV6Sjhp7dEtPjby/pGUNIWT8tGP60Jvq7fKxsVEG FYLfpTQ+V8Db0rJZNCEQkIbR4FKi8onfv46/HqTYtIGl3tiiOp WNRCwdXLgNZ+5oj9Eb/ClktNOd+BQgro3VFidfHLmUP05+Lphl 9KIvoGzDzaUykRvMyajE1eAu2mZBi91bIBIKvOKh3qoZdRWeot 8bv0qpYk8YaIGYqNKCx4XJa85Qb4Qi8HvF5QGt4JiyIjofdDTM rhGixG0VQoxKYN7fKLMYy3kCfwFCUerobq89/Za9z X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18228 Cc: =?ISO-8859-1?Q?=22Fabi=E1n_E=2E_Gallina=22?= , 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 12.08.2014 04:40, Stefan Monnier wrote: >>>> But what should electric-indent do than? >>> No re-indent upon : when it's not 100% sure of the result. >> Which sums up to switch it off. > > Not to switch off electric-indent, no (it's enabled globally). Python modes should switch it off by default. Using electric features with Python effectively requires a certain level of experience with Emacs and Python alike. Nonetheless - nice play. > > And presumably the : was made to re-indent because in some/many cases > there is only 1 correct indentation (and the code is able to find it). > I don't know if the code is also able to detect when it's correct and > when it's not, In Python indent is meaning - at least sometimes. A reliable electric-indent must know what the programmer wants to write, predict his decision. There are some special cases, where its possible. In a lot of other cases not. Alltogether, when digging in here, you run in a complex matter where artificial intelligence might deliver some progress indeed - which seems fairly out of scope giving the resources when maintaining/developing Emacs' python-modes. IMO it would be a waste of time investing here. but if it is, then we don't need to disable the "reindent > on :" in all cases. > > > Stefan > From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 10:04:15 2014 Received: (at 18228) by debbugs.gnu.org; 12 Aug 2014 14:04:15 +0000 Received: from localhost ([127.0.0.1]:40910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XHCgQ-0008L1-Ua for submit@debbugs.gnu.org; Tue, 12 Aug 2014 10:04:15 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:36051) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XHCgO-0008Kk-LK for 18228@debbugs.gnu.org; Tue, 12 Aug 2014 10:04:13 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgGAIDvNVPAqyKr/2dsb2JhbABZgwaDSr0vgwQKgRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReORzMHhDgEqwODTCE X-IPAS-Result: ArgGAIDvNVPAqyKr/2dsb2JhbABZgwaDSr0vgwQKgRcXdIIlAQEBAQIBViMFCws0EhQYDSSIBAjSGReORzMHhDgEqwODTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="86299983" Received: from 192-171-34-171.cpe.pppoe.ca (HELO pastel.home) ([192.171.34.171]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Aug 2014 10:04:06 -0400 Received: by pastel.home (Postfix, from userid 20848) id 506EE60BE1; Tue, 12 Aug 2014 10:04:06 -0400 (EDT) From: Stefan Monnier To: Andreas =?windows-1252?Q?R=F6hler?= Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode Message-ID: References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> <53E8FAFA.9060902@easy-emacs.de> <53E9BCCB.5020304@easy-emacs.de> Date: Tue, 12 Aug 2014 10:04:06 -0400 In-Reply-To: <53E9BCCB.5020304@easy-emacs.de> ("Andreas =?windows-1252?Q?R?= =?windows-1252?Q?=F6hler=22's?= message of "Tue, 12 Aug 2014 09:05:47 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18228 Cc: =?windows-1252?Q?Fabi=E1n_E=2E_Gallina?= , 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> Not to switch off electric-indent, no (it's enabled globally). > Python modes should switch it off by default. No reason for that. > Using electric features with Python effectively requires a certain level = of > experience with Emacs and Python alike. Not at all. > In Python indent is meaning - at least sometimes. I know. > There are some special cases, where its possible. > In a lot of other cases not. I know. > IMO it would be a waste of time investing here. Could be. It's up to Fabi=E1n to decide whether it's best to disable "reindent on :" or to make it smarter. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 15:34:25 2014 Received: (at 18228) by debbugs.gnu.org; 27 Aug 2014 19:34:25 +0000 Received: from localhost ([127.0.0.1]:53871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMizB-0002vQ-A3 for submit@debbugs.gnu.org; Wed, 27 Aug 2014 15:34:25 -0400 Received: from hark.woodcraft.me.uk ([80.68.94.88]:55059) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMiz8-0002vG-7F for 18228@debbugs.gnu.org; Wed, 27 Aug 2014 15:34:23 -0400 Received: from cpc1-cmbg1-0-0-cust269.5-4.cable.virginm.net ([82.21.97.14] helo=golux.woodcraft.me.uk) by hark.woodcraft.me.uk with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XMiz5-0002sO-C1; Wed, 27 Aug 2014 20:34:19 +0100 Received: from mjw by golux.woodcraft.me.uk with local (Exim 4.80) (envelope-from ) id 1XMiz4-0001sz-AE; Wed, 27 Aug 2014 20:34:18 +0100 From: Matthew Woodcraft To: Stefan Monnier Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> <53E8FAFA.9060902@easy-emacs.de> <53E9BCCB.5020304@easy-emacs.de> Date: Wed, 27 Aug 2014 20:34:18 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 12 Aug 2014 10:04:06 -0400") Message-ID: <87sikhiv5x.fsf@golux.woodcraft.me.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18228 Cc: "=?utf-8?Q?Fabi=C3=A1n?= E. Gallina" , Andreas =?utf-8?Q?R=C3=B6hler?= , 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) In emacs 24.3, colon was electric by default (eg for 'else:'), but didn't affect 'def' lines like Jorgen's example (which I am also finding very annoying). So I think this is a regression (I'm on the emacs-24 branch). -M- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 28 02:06:03 2014 Received: (at 18228) by debbugs.gnu.org; 28 Aug 2014 06:06:03 +0000 Received: from localhost ([127.0.0.1]:53990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMsqQ-0001vc-K1 for submit@debbugs.gnu.org; Thu, 28 Aug 2014 02:06:03 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:53703) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMsqN-0001v2-Ly for 18228@debbugs.gnu.org; Thu, 28 Aug 2014 02:06:00 -0400 Received: from [192.168.178.32] (brln-4dba2f76.pool.mediaWays.net [77.186.47.118]) by mrelayeu.kundenserver.de (node=mreue103) with ESMTP (Nemesis) id 0LfGuG-1WYD1s1uWW-00ooFI; Thu, 28 Aug 2014 08:05:52 +0200 Message-ID: <53FEC6A9.6060805@easy-emacs.de> Date: Thu, 28 Aug 2014 08:05:29 +0200 From: =?ISO-8859-1?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.7.0 MIME-Version: 1.0 To: Matthew Woodcraft , Stefan Monnier Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> <53E8FAFA.9060902@easy-emacs.de> <53E9BCCB.5020304@easy-emacs.de> <87sikhiv5x.fsf@golux.woodcraft.me.uk> In-Reply-To: <87sikhiv5x.fsf@golux.woodcraft.me.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:t+cnHxY9l7R7Rkd5OUSx73nGZJ6NIhYmWQppab/h2D1 GKvRJJTdIKwzHwjJ0EHvT/m3AgE5+U2I431MgV0d6F/mfPMdY9 /4lb82AEScXhIwDkBBz/yzBfZxAeaq0RCOCnudMgLcpLzQ1obJ h/3PQyvrh3tIrnCJulb4A5f4g4SVFTzEC5C8thnGcUoDU7VAZw toQOmcrqBIAmHi8FZZxoo8H5NnCMsg3ZANk02DboJIxGuWnwpn vxVhF2Oowo4FOXgPX9du4JR++2Wfu+31V85V/0xw9al8mU/R4L JEQq8ZiWT/PFRTwi4fHvIUydC+MlkHig/qLVEiGVVrOGmPdMu2 GKbYjTRWo99J2O+2e13aqEV6Vx3lmVZDIATYRLRCe X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18228 Cc: =?ISO-8859-1?Q?=22Fabi=E1n_E=2E_Gallina=22?= , 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 27.08.2014 21:34, Matthew Woodcraft wrote: > > In emacs 24.3, colon was electric by default (eg for 'else:'), but didn't > affect 'def' lines like Jorgen's example (which I am also finding very > annoying). > > So I think this is a regression (I'm on the emacs-24 branch). > > -M- > If inside a nested block, there is no way for Emacs to determine whereto such "else" should belong. I.o.w, don't see a difference between these both cases. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 28 15:00:59 2014 Received: (at control) by debbugs.gnu.org; 28 Aug 2014 19:00:59 +0000 Received: from localhost ([127.0.0.1]:52733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XN4wN-0002IW-6j for submit@debbugs.gnu.org; Thu, 28 Aug 2014 15:00:59 -0400 Received: from hark.woodcraft.me.uk ([80.68.94.88]:55255) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XN4wK-0002IM-4z for control@debbugs.gnu.org; Thu, 28 Aug 2014 15:00:56 -0400 Received: from cpc1-cmbg1-0-0-cust269.5-4.cable.virginm.net ([82.21.97.14] helo=golux.woodcraft.me.uk) by hark.woodcraft.me.uk with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XN4wI-0000xY-Gl for control@debbugs.gnu.org; Thu, 28 Aug 2014 20:00:54 +0100 Received: from mjw by golux.woodcraft.me.uk with local (Exim 4.80) (envelope-from ) id 1XN4wH-0001kx-8b for control@debbugs.gnu.org; Thu, 28 Aug 2014 20:00:53 +0100 From: Matthew Woodcraft To: control@debbugs.gnu.org Subject: #18228: 24.4.50; electrict-indent-mode bad indentation in python-mode Date: Thu, 28 Aug 2014 20:00:53 +0100 Message-ID: <87vbpcfnh6.fsf@golux.woodcraft.me.uk> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) found 18228 24.3.93 quit From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 28 15:01:06 2014 Received: (at 18228) by debbugs.gnu.org; 28 Aug 2014 19:01:06 +0000 Received: from localhost ([127.0.0.1]:52738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XN4wT-0002JW-Q2 for submit@debbugs.gnu.org; Thu, 28 Aug 2014 15:01:06 -0400 Received: from hark.woodcraft.me.uk ([80.68.94.88]:55258) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XN4wN-0002IY-SK for 18228@debbugs.gnu.org; Thu, 28 Aug 2014 15:01:00 -0400 Received: from cpc1-cmbg1-0-0-cust269.5-4.cable.virginm.net ([82.21.97.14] helo=golux.woodcraft.me.uk) by hark.woodcraft.me.uk with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XN4wK-0000xd-4M; Thu, 28 Aug 2014 20:00:56 +0100 Received: from mjw by golux.woodcraft.me.uk with local (Exim 4.80) (envelope-from ) id 1XN4wJ-0001l2-7M; Thu, 28 Aug 2014 20:00:55 +0100 From: Matthew Woodcraft To: Andreas =?utf-8?Q?R=C3=B6hler?= Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> <53E8FAFA.9060902@easy-emacs.de> <53E9BCCB.5020304@easy-emacs.de> <87sikhiv5x.fsf@golux.woodcraft.me.uk> <53FEC6A9.6060805@easy-emacs.de> Date: Thu, 28 Aug 2014 20:00:55 +0100 In-Reply-To: <53FEC6A9.6060805@easy-emacs.de> ("Andreas =?utf-8?Q?R=C3=B6h?= =?utf-8?Q?ler=22's?= message of "Thu, 28 Aug 2014 08:05:29 +0200") Message-ID: <87tx4wfnh4.fsf@golux.woodcraft.me.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18228 Cc: =?utf-8?Q?Fabi=C3=A1n_E=2E_Gallina?= , Stefan Monnier , 18228@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Andreas R=C3=B6hler writes: > If inside a nested block, there is no way for Emacs to determine whereto = such > "else" should belong. > I.o.w, don't see a difference between these both cases. What emacs 24.3 does, in the common case, is dedent the 'else:' one step. This is correct most of the time, and in the cases where it isn't correct it moves the line one step closer to where it will end up. In contrast, the behaviour in the current 24.4-pretest for 'def:' and 'class:' is wrong nearly all the time, and when it's wrong it moves the line away from where it will end up rather than towards it. -M- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 18:53:30 2014 Received: (at 18228-done) by debbugs.gnu.org; 1 Sep 2014 22:53:30 +0000 Received: from localhost ([127.0.0.1]:56025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOaTZ-0000Kz-Pw for submit@debbugs.gnu.org; Mon, 01 Sep 2014 18:53:30 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:45191 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOaTX-0000Kp-D5 for 18228-done@debbugs.gnu.org; Mon, 01 Sep 2014 18:53:28 -0400 Received: from 222-99-245-190.fibertel.com.ar ([190.245.99.222]:57459 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XOaTW-0000Yb-EJ for 18228-done@debbugs.gnu.org; Mon, 01 Sep 2014 18:53:26 -0400 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: 18228-done@debbugs.gnu.org Subject: 24.4.50; electrict-indent-mode bad indentation in python-mode Date: Mon, 01 Sep 2014 19:53:22 -0300 Message-ID: <87sikb6jh9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.7 (------) X-Debbugs-Envelope-To: 18228-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.7 (------) Fixed in revno 117470 in the Emacs 24 branch. Cheers, Fabi=C3=A1n From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 19:12:02 2014 Received: (at submit) by debbugs.gnu.org; 1 Sep 2014 23:12:02 +0000 Received: from localhost ([127.0.0.1]:56033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOalV-0000nF-HS for submit@debbugs.gnu.org; Mon, 01 Sep 2014 19:12:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45139) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOalS-0000mx-Ti for submit@debbugs.gnu.org; Mon, 01 Sep 2014 19:11:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOalH-0002Qi-Pg for submit@debbugs.gnu.org; Mon, 01 Sep 2014 19:11:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOalH-0002Qd-Mj for submit@debbugs.gnu.org; Mon, 01 Sep 2014 19:11:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOalB-0004Rs-Jr for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 19:11:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOal5-0002P5-JD for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 19:11:41 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOal5-0002P1-FY for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 19:11:35 -0400 Received: from 222-99-245-190.fibertel.com.ar ([190.245.99.222]:57490 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XOal4-0000Tk-RL for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2014 19:11:35 -0400 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: bug-gnu-emacs@gnu.org Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in python-mode References: <87egwqgezc.fsf@loki.jorgenschaefer.de> <53E86C87.4080007@easy-emacs.de> <53E8FAFA.9060902@easy-emacs.de> <53E9BCCB.5020304@easy-emacs.de> Date: Mon, 01 Sep 2014 20:11:31 -0300 In-Reply-To: <53E9BCCB.5020304@easy-emacs.de> ("Andreas =?utf-8?Q?R=C3=B6h?= =?utf-8?Q?ler=22's?= message of "Tue, 12 Aug 2014 09:05:47 +0200") Message-ID: <87oauz6in0.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -6.7 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.7 (------) Andreas R=C3=B6hler writes: > On 12.08.2014 04:40, Stefan Monnier wrote: >>>>> But what should electric-indent do than? >>>> No re-indent upon : when it's not 100% sure of the result. >>> Which sums up to switch it off. >> >> Not to switch off electric-indent, no (it's enabled globally). > > Python modes should switch it off by default. > No, it shouldn't. The electric cases can be controlled in such way in that the feature is still useful. >> >> And presumably the : was made to re-indent because in some/many cases >> there is only 1 correct indentation (and the code is able to find it). >> I don't know if the code is also able to detect when it's correct and >> when it's not, > > In Python indent is meaning - at least sometimes. > A reliable electric-indent must know what the programmer wants to write, = predict his decision. > That's what I'm aiming to and the code is pretty much there, believe it or not. > There are some special cases, where its possible. > In a lot of other cases not. > Name impossible ones and let's see. > Alltogether, when digging in here, you run in a complex matter where > artificial intelligence might deliver some progress indeed - which > seems fairly out of scope giving the resources when > maintaining/developing Emacs' python-modes. > > IMO it would be a waste of time investing here. > If because something it's "hard" we should drop any hopes of developing further, let's go back to abacuses. And no, electric indent is not that hard, really. Andreas R=C3=B6hler writes: > If inside a nested block, there is no way for Emacs to determine whereto = such > "else" should belong. > I.o.w, don't see a difference between these both cases. Well, you'd be surprised at how smart the current implementation of electric indent for python is. Even if there's no sure shot, Emacs would let you cycle between the possible indentations. I invite you to see `python-indent-dedenters-*' tests to understand what I'm talking about. Regards, Fabi=C3=A1n From unknown Fri Jun 20 19:48:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 30 Sep 2014 11:24:03 +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