[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] Stop highlighting Python2 keywords.
From: |
kobarity |
Subject: |
Re: [PATCH v3] Stop highlighting Python2 keywords. |
Date: |
Fri, 31 Jan 2025 23:53:34 +0900 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Stefan Kangas wrote:
>
> Konstantin Kharlamov <Hi-Angel@yandex.ru> writes:
>
> >> I'm not against dropping all the Python 2 builtins either.
> [...]
> >> I don't have a strong preference for either, but I agree that it is
> >> easier to explain if all of the Python 2 builtins are dropped.
> >
> > Okay, if you folks want, let's remove them all 😊 I don't have a
> > preference.
>
> I have an idea that might be gentler for folks still in need of Python 2
> support: We add a new defcustom `python-2-support`, and then disable all
> the Python 2 stuff unless that variable is customized to t.
I think such defcustom would be good, but it might be a bit cumbersome
to reflect the change to `python-font-lock-keywords-level-2' and
`python-font-lock-keywords', etc. Would it be acceptable to save the
changes and then restart Emacs?
If it is acceptable, we can also have a `defcustom' for the list of
words to highlight as builtins.
> At this point, I think we could set it to nil by default, but I don't
> have a very strong preference. We could also do that after Emacs 31, if
> other people think that is better. The main reason why I'd lean towards
> setting it to nil already in Emacs 30 is to avoid confusion for the 94%
> of users that are now using Python 3.
I agree with defaulting to nil.
> Then at some point in the future, when Python 2 support is irrelevant or
> close to it, we just make that variable obsolete.
>
> How does that sound?
>
> > I'd like to point out the code still has a `StandardError` Python 2
> > exception, should we drop it as well then?
>
> I think "StandardError" could be covered by the same user option.
>
> > I was about to do that, but then I realized this one appears also in
> > the python-ts-mode declared in the same file.
>
> AFAICT, the tree-sitter grammar supports both Python 2 and 3:
> https://github.com/tree-sitter/tree-sitter-python
I believe tree-sitter itself supports both, but
`python--treesit-builtins' only has Python 3 builtins. So I imagine
that StandardError may have been accidentally mixed in.
- Re: [RFE] python-mode: removing `file` keyword from syntax highlight, (continued)
- Re: [RFE] python-mode: removing `file` keyword from syntax highlight, Konstantin Kharlamov, 2025/01/25
- Re: [RFE] python-mode: removing `file` keyword from syntax highlight, kobarity, 2025/01/27
- [PATCH] Remove Python2 "file" from the list of keywords, Konstantin Kharlamov, 2025/01/29
- Re: [PATCH] Remove Python2 "file" from the list of keywords, kobarity, 2025/01/29
- Re: [PATCH v2] Remove Python2 "file" from the list of keywords, Konstantin Kharlamov, 2025/01/29
- Re: [PATCH v2] Remove Python2 "file" from the list of keywords, Stefan Kangas, 2025/01/29
- Re: [PATCH v2] Remove Python2 "file" from the list of keywords, Konstantin Kharlamov, 2025/01/30
- Re: [PATCH v2] Remove Python2 "file" from the list of keywords, kobarity, 2025/01/30
- Re: [PATCH v3] Stop highlighting Python2 keywords., Konstantin Kharlamov, 2025/01/30
- Re: [PATCH v3] Stop highlighting Python2 keywords., Stefan Kangas, 2025/01/30
- Re: [PATCH v3] Stop highlighting Python2 keywords.,
kobarity <=