GNU bug report logs - #56903
progmode/python.el enhancement request.

Previous Next

Package: emacs;

Reported by: Teika Kazura <teika <at> gmx.com>

Date: Wed, 3 Aug 2022 04:51:02 UTC

Severity: wishlist

To reply to this bug, email your comments to 56903 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#56903; Package emacs. (Wed, 03 Aug 2022 04:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teika Kazura <teika <at> gmx.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 03 Aug 2022 04:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: bug-gnu-emacs <at> gnu.org
Subject: progmode/python.el enhancement request.
Date: Wed, 03 Aug 2022 13:50:06 +0900 (JST)
This enhancement request is about progmode/python.el .

A
Let us follow up the commit 35d0190, "Properly indent Python PEP634 match/case blocks"
It introduced two code-block starter words, "match" and "case". Good. But "case" should also dedent, like shown in this tutorial [1], or PEP 636 [2]. (I failed to patch python.el. My naive attempt didn't work.)

[1] https://docs.python.org/3/tutorial/controlflow.html#match-statements
[2] https://peps.python.org/pep-0636/

B
"match" and "case" are not reserved words, but "soft keywords" [3]. This means they can be freely used as variables and function names.

[3] https://peps.python.org/pep-0634/#the-match-statement

I request they be font-locked like "if", "def" etc when used as a code block starter. (Something like r'^\s+(match|case)( .*)?:$'.) Currently they are shown in a plain face.

C
Some cleanups: In python.el, three comments mention "Python 3.5+ PEP492". It doesn't hurt at all, but Python 3.5 appeared back in 2015, [4] so IMHO removing them won't hurt, either.

[4] https://peps.python.org/pep-0478/

Thanks a lot for developing Emacs. Regards.
Teika




This bug report was last modified 2 years and 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.