GNU bug report logs - #75729
[PATCH] python-mode: add `exit` to the list of block-enders

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Tue, 21 Jan 2025 15:43:02 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: Stefan Kangas <stefankangas <at> gmail.com>, 75729 <at> debbugs.gnu.org
Subject: bug#75729: [PATCH v3] python-mode: add `exit` to the list of block-enders
Date: Tue, 21 Jan 2025 22:00:16 +0300
[Message part 1 (text/plain, inline)]
On Tue, 2025-01-21 at 10:52 -0800, Stefan Kangas wrote:
> Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:
> 
> > 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
> 
> Could you describe what behaviour changes this will result in?
> 
> I recommend something brief about that to the commit message too.

Thank you, done! I put the following text to the commit message, please
see if it describes the change well enough:

> `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()` and `quit()`,
> decrease the indentation level.

Patch is attached.
[1.patch (text/x-patch, attachment)]

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.