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: Eli Zaretskii <eliz <at> gnu.org>
Cc: kobarity <at> gmail.com, stefankangas <at> gmail.com, 75729-done <at> debbugs.gnu.org
Subject: bug#75729: [PATCH v4] python-mode: add `exit` to the list of block-enders
Date: Sat, 25 Jan 2025 14:04:20 +0300
On Sat, 2025-01-25 at 12:54 +0200, Eli Zaretskii wrote:
> > From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
> > Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas
> > <stefankangas <at> gmail.com>, 
> > 	75729 <at> debbugs.gnu.org
> > Date: Thu, 23 Jan 2025 01:12:32 +0300
> > 
> > On Thu, 2025-01-23 at 01:01 +0900, kobarity wrote:
> > > 
> > > Ship Mints wrote:
> > > > Do you want to consider more of the terminal calls? os.exit()
> > > > os._exit()
> > > > sys.exit() quit() (though quit raises SystemExit which could be
> > > > locally
> > > > caught; I think it's equivalent to raise SystemExit?).
> > > 
> > > I too would prefer to include these.  Because I think
> > > `sys.exit()` is
> > > recommended over `exit().
> > > 
> > > https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/consider-using-sys-exit.html
> > > 
> > > Another point is that although `exit()` ends current codeflow,
> > > `exit`
> > > does not end current codeflow.  This is where it differs from
> > > `return`, etc.
> > > 
> > > This is a bit complicated, but how about the following code?
> > > 
> > >             (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) "("))))
> > 
> > Thank you, I replaced the code and tested it, it works for me. I
> > did a
> > small change though: I moved the `(* space…` part on the new line
> > to
> > align it with `(or …)`. In the older code it looked like this text
> > is
> > part of the `(or …)` expression. But please see if it's okay this
> > way,
> > you definitely have more ELisp experience 😊
> 
> Thanks, installed on the master branch, and closing the bug.
> 
> Please in the future always mention the bug number (when known) in
> the
> commit log message.

Thank you, I'll try to remember 😊 A lot of things to keep in mind
regarding commit messages in the project, I wish Savannah git would
provide a CI that would automatically check such things…

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.