diff options
| author | kobarity | 2023-09-16 23:14:45 +0900 |
|---|---|---|
| committer | Eli Zaretskii | 2024-06-08 15:27:47 +0300 |
| commit | c03cafba390603de653def097fdcf9566d502061 (patch) | |
| tree | 3b844ea9cce930f18f4813032ee0b0f924ee5abf /lisp/progmodes/python.el | |
| parent | d7be9fdbc009ecf314e1ae9166429188b6ddb121 (diff) | |
| download | emacs-c03cafba390603de653def097fdcf9566d502061.tar.gz emacs-c03cafba390603de653def097fdcf9566d502061.zip | |
Fix Python mode error caused by incorrect indentation
* lisp/progmodes/python.el (python-indent--calculate-indentation):
Guard against negative indentation. (Bug #65870)
* test/lisp/progmodes/python-tests.el
(python-indent-badly-indented-block-end): New test.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b5c00385ef3..bb2bf1731b4 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1819,7 +1819,7 @@ possibilities can be narrowed to specific indentation points." | |||
| 1819 | (`(:after-block-end . ,start) | 1819 | (`(:after-block-end . ,start) |
| 1820 | ;; Subtract one indentation level. | 1820 | ;; Subtract one indentation level. |
| 1821 | (goto-char start) | 1821 | (goto-char start) |
| 1822 | (- (current-indentation) python-indent-offset)) | 1822 | (max 0 (- (current-indentation) python-indent-offset))) |
| 1823 | (`(:at-dedenter-block-start . ,_) | 1823 | (`(:at-dedenter-block-start . ,_) |
| 1824 | ;; List all possible indentation levels from opening blocks. | 1824 | ;; List all possible indentation levels from opening blocks. |
| 1825 | (let ((opening-block-start-points | 1825 | (let ((opening-block-start-points |