unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Teika Kazura <teika@gmx.com>
To: 56903@debbugs.gnu.org
Subject: bug#56903: progmode/python.el enhancement request.
Date: Wed, 03 Aug 2022 13:50:06 +0900 (JST)	[thread overview]
Message-ID: <20220803.135006.953852804398276472.teika@gmx.com> (raw)

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





                 reply	other threads:[~2022-08-03  4:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220803.135006.953852804398276472.teika@gmx.com \
    --to=teika@gmx.com \
    --cc=56903@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).