GNU bug report logs - #18228
24.4.50; electrict-indent-mode bad indentation in python-mode

Previous Next

Package: emacs;

Reported by: Jorgen Schaefer <forcer <at> forcix.cx>

Date: Sat, 9 Aug 2014 10:02:02 UTC

Severity: minor

Found in version 24.3.93

Fixed in version 24.4.50

Done: fgallina <at> gnu.org (Fabián Ezequiel Gallina)

Bug is archived. No further changes may be made.

Full log


Message #20 received at 18228 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: "Fabián E. Gallina" <fabian <at> anue.biz>,
 18228 <at> debbugs.gnu.org
Subject: Re: bug#18228: 24.4.50; electrict-indent-mode bad indentation in
 python-mode
Date: Tue, 12 Aug 2014 09:05:47 +0200
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
>





This bug report was last modified 10 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.