aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorDmitry Gutov2023-03-09 17:24:54 +0200
committerDmitry Gutov2023-03-09 17:31:21 +0200
commit29228e24f20954b93dccef4ac5d704ca31daa80c (patch)
treee691567c2a92435c4313774c5478a86bf5eeae2e /lisp/progmodes/python.el
parent01b65d442ad681e6fef0db76451e668125a17038 (diff)
downloademacs-29228e24f20954b93dccef4ac5d704ca31daa80c.tar.gz
emacs-29228e24f20954b93dccef4ac5d704ca31daa80c.zip
python-info-dedenter-opening-block-positions: Fix to support "bare" match
* lisp/progmodes/python.el (python-info-dedenter-opening-block-positions): Make the check stricter. Require that block starts only at indentation. * test/lisp/progmodes/python-tests.el (python-indent-after-bare-match): Another test (bug#62031).
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 5b11d204de1..1980815bae9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5792,7 +5792,9 @@ likely an invalid python file."
5792 (while (python-nav--syntactically 5792 (while (python-nav--syntactically
5793 (lambda () 5793 (lambda ()
5794 (cl-loop while (re-search-backward (python-rx block-start) nil t) 5794 (cl-loop while (re-search-backward (python-rx block-start) nil t)
5795 if (memq (char-before) '(nil ?\s ?\t ?\n)) 5795 if (save-match-data
5796 (looking-back (rx line-start (* whitespace))
5797 (line-beginning-position)))
5796 return t)) 5798 return t))
5797 #'<) 5799 #'<)
5798 (let ((indentation (current-indentation))) 5800 (let ((indentation (current-indentation)))