unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Lele Gaifax <lele@metapensiero.it>, 62031@debbugs.gnu.org
Cc: Rob Moss <robm.dev@gmail.com>
Subject: bug#62031: 29.0.60; python-mode indentation after re.match
Date: Wed, 8 Mar 2023 20:15:03 +0200	[thread overview]
Message-ID: <d4950831-9859-b7a1-db4c-c632476cec04@yandex.ru> (raw)
In-Reply-To: <69793abf-3d2f-2dbe-698b-877ededfc56b@yandex.ru>

On 08/03/2023 19:57, Dmitry Gutov wrote:
> After some edebug-ing, the patch below seems to fix this case

Small correction for cases outside of any blocks:

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 1f970633bfc..81475f31f60 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5792,7 +5792,9 @@ python-info-dedenter-opening-block-positions
            (catch 'exit
              (while (python-nav--syntactically
                      (lambda ()
-                      (re-search-backward (python-rx block-start) nil t))
+                      (cl-loop for pt = (re-search-backward (python-rx 
block-start) nil t)
+                               until (memq (char-before) '(nil ?\s ?\t 
?\n))
+                               finally return pt))
                      #'<)
                (let ((indentation (current-indentation)))
                  (when (and (not (memq indentation collected-indentations))






      parent reply	other threads:[~2023-03-08 18:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07  4:44 bug#62031: 29.0.60; python-mode indentation after re.match Rob Moss
2023-03-07 14:35 ` Dmitry Gutov
2023-03-07 14:57   ` Lele Gaifax
2023-03-07 23:31     ` Rob Moss
2023-03-08  7:53       ` Lele Gaifax
2023-03-08 13:23         ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-08 22:46           ` Dmitry Gutov
2023-03-09  2:31             ` Rob Moss
2023-03-08 13:54         ` Eli Zaretskii
2023-03-08 17:57         ` Dmitry Gutov
2023-03-08 18:10           ` Lele Gaifax
2023-03-08 20:52             ` Dmitry Gutov
2023-03-09  3:04               ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-09 15:29                 ` kobarity
2023-03-09 15:42                   ` Dmitry Gutov
2023-03-09 15:44                   ` Lele Gaifax
2023-03-09 15:40                 ` Dmitry Gutov
2023-03-08 18:15           ` Dmitry Gutov [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=d4950831-9859-b7a1-db4c-c632476cec04@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=62031@debbugs.gnu.org \
    --cc=lele@metapensiero.it \
    --cc=robm.dev@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).