unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61090: [PATCH 29] python.el: Use correct regexp when enabling python-ts-mode
@ 2023-01-27  1:46 Brian Leung
  2023-01-28 11:28 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Leung @ 2023-01-27  1:46 UTC (permalink / raw)
  To: 61090

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

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'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-python.el-Use-correct-regexp-when-enabling-python-ts.patch --]
[-- Type: text/patch, Size: 1084 bytes --]

From 73d2c15d3813629a51046e115768b6fb1c141733 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#61090: [PATCH 29] python.el: Use correct regexp when enabling python-ts-mode
  2023-01-27  1:46 bug#61090: [PATCH 29] python.el: Use correct regexp when enabling python-ts-mode Brian Leung
@ 2023-01-28 11:28 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-01-28 11:28 UTC (permalink / raw)
  To: Brian Leung; +Cc: 61090-done

> From: Brian Leung <leungbk@posteo.net>
> Date: Fri, 27 Jan 2023 01:46:07 +0000
> 
> This prevents python-ts-mode from being enabled for files that simply
> have the word "python" in them.

Thanks, I installed this on the emacs-29 branch.

Could you please in the future use the same email address as the one
you stated in your copyright assignment?  That should avoid confusion
regarding the state of your assignment.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-28 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-27  1:46 bug#61090: [PATCH 29] python.el: Use correct regexp when enabling python-ts-mode Brian Leung
2023-01-28 11:28 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).