GNU bug report logs - #43298
27.1; Do font locking for Python 3, not 2

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: 43298 <at> debbugs.gnu.org
Subject: bug#43298: 27.1; Do font locking for Python 3, not 2
Date: Thu, 10 Sep 2020 19:23:18 +0200
This is one of my long-standing pet peeves, thanks for filing an issue
about it.  FWIW here is how I thought I'd go about fixing this Whenever
I'd Find The Time™ (… needless to say, if anyone wants to beat me to it,
there'll be no hard feelings):

1. Add fontification tests for the current fontification.
   (Because I expected the overall patch to be quite big, and I figured
   it'd be easier to get it merged if it came with a bunch of
   non-regression tests.)

2. Create 3 sets of font-lock settings in python.el: -2, -3, and
   -undecided (= whatever the current settings do).

3. Add a variable to control which settings to use (settable through
   Customize or through file/directory-local variables).

4. Add heuristics to pick the "right" style by default (e.g. look for a
   shebang).


On the one hand, I agree that Emacs should be py3k-compliant by now
out-of-the-box.  On the other hand, I'd bet there are a lot of poor
souls out there who will be stuck maintaining Python 2 code for a few
more years.  Messing with font-lock without giving them an escape hatch
sounds like some form of double-jeopardy…





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.