GNU bug report logs -
#75729
[PATCH] python-mode: add `exit` to the list of block-enders
Previous Next
Full log
View this message in rfc822 format
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Date: Tue, 21 Jan 2025 18:41:54 +0300
>
>
> `exit()` ends current codeflow, there can't be any code past it. So
> account `exit` similarly to `return`, `continue`, etc.
>
> From 7806987dd88b2507d97255c2e6ca989e791c798b Mon Sep 17 00:00:00 2001
> From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> Date: Tue, 21 Jan 2025 18:34:54 +0300
> Subject: [PATCH] python-mode: add `exit` to the list of block-enders
>
> `exit()` ends current codeflow, there can't be any code past it. So
> account `exit` similarly to `return`, `continue`, etc.
>
> * /lisp/progmodes/python.el (python-rx): add `exit` to the list of
> block-enders.
This should start with a capital letter (to be a complete sentence).
> ---
> lisp/progmodes/python.el | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 16c296a8f86..2feb9f47e1a 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -442,7 +442,8 @@ python-rx
> symbol-end))
> (block-ender (seq symbol-start
> (or
> - "break" "continue" "pass" "raise" "return")
> + "break" "continue" "pass" "raise" "return"
> + "exit")
> symbol-end))
> (decorator (seq line-start (* space) ?@ (any letter ?_)
> (* (any word ?_))))
> --
> 2.48.1
>
Thanks. kobarity, any comments?
This bug report was last modified 180 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.