From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#63959: python-mode does not keep indentation in square brackets [] Date: Fri, 09 Jun 2023 23:35:30 +0900 Message-ID: References: <0a9099c91a3cd323c78e08fb6263d11fe66429bb.camel@yandex.ru> <83mt18285n.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40870"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 63959@debbugs.gnu.org, Stefan Monnier , Konstantin Kharlamov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 09 16:36:24 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7dE0-000AO3-Od for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jun 2023 16:36:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7dDi-0005hO-IF; Fri, 09 Jun 2023 10:36:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7dDe-0005c9-By for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 10:36:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7dDe-00068n-3G for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 10:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q7dDd-0003vv-Uj for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 10:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2023 14:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63959 X-GNU-PR-Package: emacs Original-Received: via spool by 63959-submit@debbugs.gnu.org id=B63959.168632136115114 (code B ref 63959); Fri, 09 Jun 2023 14:36:01 +0000 Original-Received: (at 63959) by debbugs.gnu.org; 9 Jun 2023 14:36:01 +0000 Original-Received: from localhost ([127.0.0.1]:59991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7dDd-0003vg-1O for submit@debbugs.gnu.org; Fri, 09 Jun 2023 10:36:01 -0400 Original-Received: from mail-pf1-f171.google.com ([209.85.210.171]:54548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7dDa-0003vT-RN for 63959@debbugs.gnu.org; Fri, 09 Jun 2023 10:35:59 -0400 Original-Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-65131e85be4so1916077b3a.1 for <63959@debbugs.gnu.org>; Fri, 09 Jun 2023 07:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686321351; x=1688913351; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=lSIn5X+nrO2Oo+JKTcu8zqYg9ldVIJ5K1ZEj/4IKH34=; b=eoG1Z6bLuiap9KfLkZEK5/UV7LPKbQ2ZvoZ8lyfl+OoVddgVAaqJuwM2xBagP9Fvzr XtCfZIkjIG0jejHLk4XUcJ2tfTsOE6gx+TaE3ZzYFo/ViRAV62E/pulmymkfDnR9lLvo JqfYb2wRjvHHVgtgASgnc4XuGncMy6dTtAZgwXQvjNFmBaDLU19ruSO0i2VGKZx6BoGz NdHqClvPNjFsZv+hZTTFouGjY1BahEznAMWnXWx5Imhjhl9rOUL62t3NT6WlpiMcrBfS HnlmFVqdBDxei0fDOsTzyuyjzgdfRlwxI5uuiVrSFj66d/5/pDsy09V+dxFJ+noyj1am +vWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686321351; x=1688913351; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lSIn5X+nrO2Oo+JKTcu8zqYg9ldVIJ5K1ZEj/4IKH34=; b=axoCRVfhC7Wr8Hgo0OqxPX5CFyz4Agw0SCWUE+NOv5P0Vos17k8a2JhkdisGkZCYI/ 9DrtH1D95DXzscIDcCKs80DqqjnUQ/p2l0apI7fkpv95C4lbi8QFXusi/JXWry6UxW1s ENlXpKp5Y1WjdMySB5ftfoXrU4qIP6sr3j6kWZMpLG1ejYbP9jXMFQpL9VzUMhm0aeFU CsF0AVrCOJEAWsHUuY+DBUcZPeL+mHEq5hCE6TBbMhCTHeHM94SUITtChV1OKeGSwtDB 9RavpbK2FrADlFeE/9a6UT5+ezpNNiHPddTfYfBTG6RNW+9AvmoS6ecshYLrDPz0EoiK U6Gw== X-Gm-Message-State: AC+VfDzcqiIELIwg+5F831atDqCC/PLiulO6rZg75JwXu6goDxJeeg0w DCYzU7Co/WM3rmaiVgI9p/Q= X-Google-Smtp-Source: ACHHUZ60IPgVGqPkoi4f5sfcqv8b2JK0jfnGjLqP+uuwMT7wlVG4ULrL5Z3sEeUH+bR8btyp1PG9SA== X-Received: by 2002:a05:6a20:8f11:b0:10b:40a9:ec48 with SMTP id b17-20020a056a208f1100b0010b40a9ec48mr1785462pzk.29.1686321350568; Fri, 09 Jun 2023 07:35:50 -0700 (PDT) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d16-20020aa78690000000b006505bae11bcsm2791480pfo.23.2023.06.09.07.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 07:35:50 -0700 (PDT) In-Reply-To: <83mt18285n.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263159 Archived-At: Eli Zaretskii wrote: > > From: Konstantin Kharlamov > > 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.