I'm facing the same problem as OP in this question: How can I make python-mode correctly indent python's match statement?.
A quote from the OP: "Python 3.10 added a match statement. When I try and type one in emacs 27.2, it does not indent it correctly, presumably because it does not yet have support for it. How do I get python-mode to indent the match statement correctly?"
One contributor suggested M-x find-library RET python RET
and just append the two keywords (match and case) to appropriate places. I did just that. For a while Emacs was working wonderfully with indenting the match and case statements. However as of now the indentation and block syntax highlighting etc. is not working at all. I have tried loading python.el by load-file RET RET
but of no avail. Here is an example of my additions:
`(rx-let ((block-start (seq symbol-start
(or "def" "class" "if" "elif" "else" "try"
"except" "finally" "for" "while" "with"
;; Added by @Keyboard_Crasher.
"match" "case"
;; Python 3.5+ PEP492
(and "async" (+ space)
(or "def" "for" "with")))
symbol-end))
The question is: how to fix this annoying lack of indentation and syntax highlighting?