From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brian Leung Newsgroups: gmane.emacs.bugs Subject: bug#61090: [PATCH 29] python.el: Use correct regexp when enabling python-ts-mode Date: Fri, 27 Jan 2023 01:46:07 +0000 Message-ID: <87wn58hhr4.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37530"; mail-complaints-to="usenet@ciao.gmane.io" To: 61090@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 27 02:47:18 2023 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 1pLDpl-0009VG-H3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Jan 2023 02:47:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLDpY-0000jr-U0; Thu, 26 Jan 2023 20:47:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLDpX-0000jX-0L for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 20:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLDpW-0005Ff-H7 for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 20:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pLDpV-0004du-SO for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 20:47:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Brian Leung Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jan 2023 01:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61090 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167478398417794 (code B ref -1); Fri, 27 Jan 2023 01:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jan 2023 01:46:24 +0000 Original-Received: from localhost ([127.0.0.1]:36504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLDot-0004cw-Ka for submit@debbugs.gnu.org; Thu, 26 Jan 2023 20:46:23 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLDor-0004cn-EB for submit@debbugs.gnu.org; Thu, 26 Jan 2023 20:46:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLDor-0000fR-7B for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 20:46:21 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLDon-0003D1-Tj for bug-gnu-emacs@gnu.org; Thu, 26 Jan 2023 20:46:20 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C99AA24061B for ; Fri, 27 Jan 2023 02:46:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674783973; bh=eVc8SnKucbWfHzyUuIxAg2WPNcDlaCUFkVjPRrBgCcA=; h=From:To:Subject:Date:From; b=sCjxqILaQCTZyStEwHyh+0fq0pIn+gSysmnycyLdlgVMVN4AbWiX25RbW0YpxQ55d Ao1moBqf5FZq+ll1PRDZ2MBsgRB0gBWfN4NfSyR0m0I7rnmpnbLo4rwVv/xDWFCyQP 0O2aoQvqfQarF6fVOWPmRrT5uu8Q0KsbMAJwJDfRUYO9hgOb6Y1BtAtmU02HSFhZ1Z kHVcPccAfFKwJAm9MF7OmxLkvPM8KbZr+YYVrRkB+8ISc+EMO7CXEfY86C0PfBuKWU gb+vJFpkPT7GzePWrk/Vtz/LnphRDmJRiIo+PCFZPcyTB/vqmNAS2xB+gvEFJZ8+Pa oZVJJA2f8HdZg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P30m21D8dz9rxD for ; Fri, 27 Jan 2023 02:46:09 +0100 (CET) Received-SPF: pass client-ip=185.67.36.65; envelope-from=leungbk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254242 Archived-At: --=-=-= Content-Type: text/plain Tags: patch This prevents python-ts-mode from being enabled for files that simply have the word "python" in them. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) Repository revision: dfdc0f5fb7b10e737c3c8e2bdb1eb873a1e91bd7 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: NixOS 23.05 (Stoat) Configured using: 'configure --prefix=/nix/store/388qs9mv3l43d0k1q160z389sdmfi8pr-emacs-git-20230126.0 --disable-build-details --with-modules --with-x-toolkit=lucid --with-xft --with-cairo --with-native-compilation' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-python.el-Use-correct-regexp-when-enabling-python-ts.patch >From 73d2c15d3813629a51046e115768b6fb1c141733 Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Thu, 26 Jan 2023 17:36:42 -0800 Subject: [PATCH] python.el: Use correct regexp when enabling python-ts-mode * lisp/progmodes/python.el: Use "python[0-9.]*" regexp for interpreter-mode-alist, and not auto-mode-alist. --- lisp/progmodes/python.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a869cdc5fdb..df0d1c96965 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6715,8 +6715,8 @@ python-ts-mode (when python-indent-guess-indent-offset (python-indent-guess-indent-offset)) - (add-to-list 'auto-mode-alist - '("\\.py[iw]?\\'\\|python[0-9.]*" . python-ts-mode)))) + (add-to-list 'auto-mode-alist '("\\.py[iw]?\\'" . python-ts-mode)) + (add-to-list 'interpreter-mode-alist '("python[0-9.]*" . python-ts-mode)))) ;;; Completion predicates for M-x ;; Commands that only make sense when editing Python code -- 2.39.0 --=-=-=--