]> git.eshelyaron.com Git - emacs.git/commit
python-mode: add 'exit' and 'quit' to the list of block-enders
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Tue, 21 Jan 2025 15:34:54 +0000 (18:34 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 25 Jan 2025 17:49:03 +0000 (18:49 +0100)
commitf88bfa5bacb6edba7ebceafbb264169a01cd5157
tree6c6e995f3805ec2d8d029cecb36ddf7e3b0a9faf
parentba0f17d1b9991a09004e21e5c7e720ff58d94d54
python-mode: add 'exit' and 'quit' to the list of block-enders

'exit()' and 'quit()' end the current codeflow, there can't be
any code past it, similarly to 'return', 'continue', etc.  So
when calculating indentation for the line next to 'exit()',
'os.exit()', 'os._exit()', 'sys.exit()' and 'quit()', decrease
the indentation level.
* /lisp/progmodes/python.el (python-rx): Add 'exit()', 'os.exit()',
'os._exit()', 'sys.exit()', 'quit' to the list of block-enders.
(Bug#75729)

(cherry picked from commit 0514619b2c944ae17fbf649496595c5e866ff785)
lisp/progmodes/python.el