From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#43298: 27.1; Do font locking for Python 3, not 2 Date: Thu, 10 Sep 2020 19:23:18 +0200 Message-ID: <87v9gl1r7d.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32750"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 43298@debbugs.gnu.org Cancel-Lock: sha1:UvMq67NqZsXLjOmM/ZvJ0T2ioHg= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 10 19:24:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGQIq-0008RJ-EF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Sep 2020 19:24:08 +0200 Original-Received: from localhost ([::1]:50320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGQIp-0004jA-HO for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Sep 2020 13:24:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGQIk-0004iz-RF for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 13:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGQIk-0000SY-Ic for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 13:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kGQIk-00036z-Cf for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 13:24:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Sep 2020 17:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43298 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159975861811933 (code B ref -1); Thu, 10 Sep 2020 17:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Sep 2020 17:23:38 +0000 Original-Received: from localhost ([127.0.0.1]:41103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGQIM-00036O-8O for submit@debbugs.gnu.org; Thu, 10 Sep 2020 13:23:38 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:44970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGQIK-00036G-Hu for submit@debbugs.gnu.org; Thu, 10 Sep 2020 13:23:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGQIK-0004hv-CD for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 13:23:36 -0400 Original-Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:46942 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGQII-0000Oj-Jr for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 13:23:36 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kGQIE-0007b6-Lk for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2020 19:23:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/10 13:23:30 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:187749 Archived-At: 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…