GNU bug report logs - #42513
Python indentation bug when using multi-line on an if-condition

Previous Next

Package: emacs;

Reported by: swedebugia <swedebugia <at> riseup.net>

Date: Fri, 24 Jul 2020 09:41:02 UTC

Severity: normal

Full log


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

From: Dale Sedivec <dale <at> codefu.org>
To: 42513 <at> debbugs.gnu.org
Subject: Possible fix for Python indentation problem
Date: Tue, 15 Sep 2020 18:25:29 -0500
FYI I'm testing this fix against master:

diff --git a/python.el b/python.el
index b36a583..24f5f87 100644
--- a/python.el
+++ b/python.el
@@ -4991,6 +4991,7 @@ likely an invalid python file."
                            ;; block and the current line, otherwise it
                            ;; is not an opening block.
                            (save-excursion
+                             (python-nav-end-of-statement)
                              (forward-line)
                              (let ((no-back-indent t))
                                (save-match-data

(https://github.com/dsedivec/python/commit/7d2a97ca995c4a6673fa68861e42c54c9e8f6596.diff if my MUA mangles that.)

All this does is move to the end of the block opener (e.g. the "if" statement) before moving to the next line, where it expects to be within the "if"s block.

Dale



This bug report was last modified 4 years and 137 days ago.

Previous Next


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