all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kobarity <kobarity@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 63959@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	Konstantin Kharlamov <hi-angel@yandex.ru>
Subject: bug#63959: python-mode does not keep indentation in square brackets []
Date: Fri, 09 Jun 2023 23:35:30 +0900	[thread overview]
Message-ID: <eke7o7lo7lfx.wl-kobarity@gmail.com> (raw)
In-Reply-To: <83mt18285n.fsf@gnu.org>


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	other threads:[~2023-06-09 14:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  9:39 bug#63959: python-mode does not keep indentation in square brackets [] Konstantin Kharlamov
2023-06-09 11:21 ` Eli Zaretskii
2023-06-09 14:35   ` kobarity [this message]
2023-06-18 14:56     ` kobarity
2023-06-18 15:20       ` Konstantin Kharlamov
2023-06-19  8:46         ` Andreas Röhler
2023-06-24 12:37           ` kobarity
2023-06-28  6:58             ` Andreas Röhler
2023-07-01 13:42               ` kobarity
2023-07-01 13:57                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-24 12:14         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eke7o7lo7lfx.wl-kobarity@gmail.com \
    --to=kobarity@gmail.com \
    --cc=63959@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=hi-angel@yandex.ru \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.