GNU bug report logs -
#43298
27.1; Do font locking for Python 3, not 2
Previous Next
Reported by: Per Starbäck <starback <at> cl.lingfil.uu.se>
Date: Wed, 9 Sep 2020 21:09:01 UTC
Severity: normal
Found in version 27.1
Fixed in version 29.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In GNU Emacs 27.1:
$ emacs -Q -f /tmp/new.py
for RET print RET len RET
"print" gets the same colour as "for", that is as a keyword.
I think it should get the same as "len", that is as a builtin
function.
Python.el has a section
;; Python 2:
"print" "exec"
because in Python 2 these two were keywords. But in Python 3 they are built-in
functions.
I think it's overkill to try to determine if the buffer contains Python 2 or 3
and highlight them differently. Using the same fontlocking is good enough,
since it's not a big problem to get these in the wrong colour.
But now when Python 2 is officially discontinued I think it's time to
let it follow Python 3 and get the small inconvenience when editing old
code and not when editing current code.
This bug report was last modified 3 years and 222 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.