bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63959: python-mode does not keep indentation in square brackets []


From: kobarity
Subject: bug#63959: python-mode does not keep indentation in square brackets []
Date: Fri, 09 Jun 2023 23:35:30 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Eli Zaretskii wrote:
> > From: Konstantin Kharlamov <hi-angel@yandex.ru>
> > Date: Thu, 08 Jun 2023 12:39:23 +0300
> > 
> > Usually in programming modes, when previous indentation is kind of 
> > "special",
> > the new lines should keep the indentation from the previous line. However, 
> > it
> > doesn't work in this case.
> > 
> > 
> > # Steps to reproduce
> > 
> > 1. Create file `test.py` with following content:
> > 
> >     for infix in [ # some description
> >                   "_cdata", "_cmeta", "_corig", "_cpool", "_cvol", 
> > "_wcorig",
> >                   "indentation is broken here", "bar"]:
> >         print(infix)
> > 
> > 2. Open it as `emacs -Q test.py`
> > 3. Put a caret on the 3rd line (which says "indentation is broken"
> > 4. Press TAB
> > 
> > 
> > ## Expected
> > 
> > Indentation won't change
> > 
> > ## Actual
> > 
> > The line goes back by 4 spaces or so
> > 
> > # Additional information
> > 
> > emacs version: compiled from latest git a week ago, commit 5cace109d2b
> 
> kobarity, any comments?

I think the current Python mode tries to indent based on parens,
regardless of the indentation of the previous line.  However, it would
also be reasonable to maintain the indentation of the previous line.
I will see if I can implement it.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]