'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)
(dedenter (seq symbol-start
(or "elif" "else" "except" "finally" "case")
symbol-end))
- (block-ender (seq symbol-start
- (or
- "break" "continue" "pass" "raise" "return")
- symbol-end))
+ (block-ender (seq
+ symbol-start
+ (or
+ (seq (or
+ "break" "continue" "pass" "raise" "return")
+ symbol-end)
+ (seq
+ (or
+ (seq (? (or (seq "os." (? ?_)) "sys.")) "exit")
+ "quit")
+ (* space) "("))))
(decorator (seq line-start (* space) ?@ (any letter ?_)
(* (any word ?_))))
(defun (seq symbol-start