diff options
| author | Dmitry Gutov | 2023-03-09 17:24:54 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2023-03-09 17:31:21 +0200 |
| commit | 29228e24f20954b93dccef4ac5d704ca31daa80c (patch) | |
| tree | e691567c2a92435c4313774c5478a86bf5eeae2e /lisp/progmodes/python.el | |
| parent | 01b65d442ad681e6fef0db76451e668125a17038 (diff) | |
| download | emacs-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.el | 4 |
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))) |