Subject: Re: 29.0.60; python-ts-mode interferes with the major-mode of other files.
From: xiliuya <[email-masked]>
To: [email-masked]
Date: Mon, 30 Jan 2023 00:39:38 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

When my el files are under ~/test/python/xx/, that’s the problem.
But under the same circumstances, python-mode won’t have that problem.

xiliuya <[email-masked]> writes:

> My operations are as follows:
>  1. opening a python script.
>  2. switching to python-ts-mode.
>  3. opening an el file.
>
> And then the major-mode of the el file became python-ts-mode.
> I’ve tested it under ’emacs -Q’, and it will come up.
>
>
> In GNU Emacs 29.0.60 (build 5, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.36, cairo version 1.17.6) of 2023-01-26 built on xiliuya-pc
> Repository revision: af28191b04fa3e70caeea83c1c8a6c16a57adece
> Repository branch: makepkg
> System Description: Arch Linux
>
> Configured using:
>  'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
>  --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
>  --with-modules --without-libotf --without-m17n-flt --without-gconf
>  --with-native-compilation=yes --with-xinput2 --with-pgtk
>  --without-xaw3d --with-sound=no --with-tree-sitter --without-gpm
>  --without-compress-install
>  '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
>  'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
>  -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
>  -fstack-clash-protection -fcf-protection'
>  LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
>
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
> LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK
> PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
> WEBP XIM GTK3 ZLIB
>
> Important settings:
>   value of $LANG: zh_CN.UTF-8
>   value of $XMODIFIERS: @im=fcitx
>   locale-coding-system: utf-8
>
> Major mode: Messages
>
> Minor modes in effect:
>   dimmer-mode: t
>   default-text-scale-mode: t
>   recentf-mode: t
>   vertico-mode: t
>   marginalia-mode: t
>   winner-mode: t
>   global-corfu-mode: t
>   corfu-mode: t
>   global-anzu-mode: t
>   anzu-mode: t
>   yas-global-mode: t
>   yas-minor-mode: t
>   savehist-mode: t
>   electric-pair-mode: t
>   delete-selection-mode: t
>   global-auto-revert-mode: t
>   global-so-long-mode: t
>   mode-line-bell-mode: t
>   global-page-break-lines-mode: t
>   whole-line-or-region-global-mode: t
>   whole-line-or-region-local-mode: t
>   hes-mode: t
>   which-key-mode: t
>   global-whitespace-cleanup-mode: t
>   global-diff-hl-mode: t
>   projectile-rails-global-mode: t
>   projectile-mode: t
>   ipretty-mode: t
>   auto-compile-on-load-mode: t
>   auto-compile-on-save-mode: t
>   immortal-scratch-mode: t
>   server-mode: t
>   mu4e-column-faces-mode: t
>   diredfl-global-mode: t
>   org-roam-db-autosync-mode: t
>   pyim-isearch-mode: t
>   evil-escape-mode: t
>   shell-dirtrack-mode: t
>   evil-mode: t
>   evil-local-mode: t
>   windmove-mode: t
>   desktop-save-mode: t
>   tooltip-mode: t
>   global-eldoc-mode: t
>   show-paren-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   blink-cursor-mode: t
>   buffer-read-only: t
>   column-number-mode: t
>   line-number-mode: t
>   transient-mark-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
>
> Load-path shadows:
> /home/xiliuya/.emacs.d/elpa-29.0/protobuf-mode-20221213.3/protobuf-mode hides /usr/share/emacs/site-lisp/protobuf-mode
> /home/xiliuya/.emacs.d/elpa-29.0/transient-20230124.2013/transient hides /usr/share/emacs/29.0.60/lisp/transient
> /home/xiliuya/.emacs.d/lisp/erc-sasl hides /usr/share/emacs/29.0.60/lisp/erc/erc-sasl
>
> Features:
> (shadow rainbow-mode help-fns radix-tree sdcv pos-tip popup showtip pyim
> pyim-cloudim pyim-probe pyim-preview pyim-page posframe pyim-indicator
> pyim-autoselector pyim-process pyim-punctuation pyim-outcome
> pyim-candidates pyim-codes pyim-entered kind-icon svg-lib
> consult-vertico consult emacsbug epa-file executable dimmer face-remap
> default-text-scale recentf tree-widget orderless vertico marginalia
> winner windswap info-colors checkdoc disp-table org-mpv-notes mpv tq
> org-timer org-modern org-indent oc-basic ol-eww eww url-queue mm-url
> ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview doc-view
> jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi
> org-link-doi protobuf-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds
> cc-styles cc-align cc-engine cc-vars cc-defs vc-svn corfu anzu eglot
> external-completion array jsonrpc ert debug backtrace vc-git vc-darcs
> yasnippet-snippets yasnippet elisp-slime-nav etags fileloop xref paredit
> aggressive-indent highlight-quoted package-lint-flymake package-lint
> let-alist imenu finder hideshow flymake-flycheck flycheck flymake-proc
> flymake display-line-numbers display-fill-column-indicator
> rainbow-delimiters symbol-overlay bug-reference goto-addr savehist
> elec-pair delsel autorevert filenotify so-long mode-line-bell
> page-break-lines whole-line-or-region highlight-escape-sequences
> which-key diminish whitespace-cleanup-mode whitespace diff-hl log-view
> pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode projectile-rails rake f
> f-shortdoc s inflections inf-ruby ruby-mode smie autoinsert projectile
> skeleton find-dired lisp-mnt grep compile ibuf-ext ibuffer
> ibuffer-loaddefs ipretty auto-compile immortal-scratch uptimes server
> init init-local init-mu4e authinfo cl mu4e-column-faces inline cus-edit
> cus-load mu4e mu4e-org mu4e-main mu4e-view gnus-art mm-uu mml2015
> mm-view mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo
> gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo
> parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win gnus nnheader
> range wid-edit mu4e-headers mu4e-compose mu4e-draft mu4e-actions
> mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message shr
> pixel-fill kinsoku url-file svg xml dom flow-fill mule-util hl-line
> mu4e-contacts mu4e-update mu4e-folders mu4e-server mu4e-context
> mu4e-vars mu4e-helpers mu4e-config bookmark pp ido message yank-media
> puny dired-x diredfl dired dired-loaddefs rfc822 mml mml-sec epa epg
> rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies
> mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader smtpmail
> sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
> trans-rpc gif-screencast erc-sasl erc-backend erc-common erc-compat
> org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id
> org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam
> org-capture org-element org-persist xdg avl-tree generator org-attach
> org-id org-refile ob-sqlite ob-sql ob-shell ob-ruby ob-python python
> project treesit ob-plantuml ob-octave ob-latex ob-gnuplot ob-dot
> ob-ditaa ob-R org-clock org ob ob-tangle ob-ref ob-lob ob-table ob-exp
> org-macro org-src ob-comint org-pcomplete org-list org-footnote
> org-faces org-entities time-date noutline outline ob-emacs-lisp ob-core
> ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc
> org-loaddefs find-func cal-menu calendar cal-loaddefs org-version
> org-compat org-macs emacsql-sqlite emacsql emacsql-compiler
> magit-section benchmark format-spec compat dash pyim-cregexp-utils
> pyim-dhashcache sort pyim-cstring async pyim-cregexp xr pyim-imobjs
> pyim-pinyin pyim-dcache pyim-pymap pyim-scheme pyim-common pyim-basedict
> pyim-dict evil-escape pcase evil evil-keybindings evil-integration
> evil-maps evil-commands reveal evil-jumps evil-command-window
> evil-search evil-ex shell pcomplete comint ansi-osc evil-types
> evil-macros evil-repeat evil-states evil-core advice evil-common
> windmove calc calc-loaddefs calc-macs thingatpt rect evil-digraphs
> evil-vars ring edmacro kmacro init-locales session
> sanityinc-tomorrow-bright-theme color-theme-sanityinc-tomorrow color
> init-direnv init-ledger init-dash init-folding init-misc
> init-common-lisp init-clojure-cider init-clojure init-slime init-lisp
> init-paredit init-nix init-terraform init-docker init-yaml init-toml
> init-rust init-nim init-j init-ocaml init-sql init-rails init-ruby
> init-purescript init-elm init-haskell init-python reformatter ansi-color
> init-http init-haml init-css init-html init-nxml init-org init-php
> init-javascript easy-mmode init-erlang erlang-start init-csv
> init-markdown init-textile init-crontab init-compile init-projectile
> init-github init-git init-darcs init-vc init-whitespace
> init-editing-utils init-mmm mmm-auto mmm-vars mmm-utils mmm-compat
> init-sessions desktop frameset init-windows init-corfu
> init-hippie-expand init-minibuffer init-recentf init-eglot init-flymake
> init-ibuffer ibuf-macs init-uniquify init-grep init-isearch init-dired
> init-gui-frames init-osx-keys init-themes init-xterm init-frame-hooks
> init-exec-path exec-path-from-shell init-elpa fullframe finder-inf
> scratch-autoloads rainbow-delimiters-autoloads origami-autoloads
> message-view-patch-autoloads disable-mouse-autoloads
> rainbow-mode-autoloads cljsbuild-mode-autoloads diff-hl-autoloads
> nix-buffer-autoloads valign-autoloads quick-peek-autoloads
> orderless-autoloads embark-consult-autoloads dotenv-mode-autoloads
> affe-autoloads org-modern-autoloads symbol-overlay-autoloads
> docker-compose-mode-autoloads ac-emoji-autoloads auto-complete-autoloads
> diredfl-autoloads lua-mode-autoloads elein-autoloads fullframe-autoloads
> sdcv-autoloads popup-autoloads nix-sandbox-autoloads
> dune-format-autoloads nixos-options-autoloads
> exec-path-from-shell-autoloads haskell-mode-autoloads
> js-comint-autoloads json-mode-autoloads json-snatcher-autoloads
> org-msg-autoloads crontab-mode-autoloads flycheck-clojure-autoloads
> color-theme-sanityinc-tomorrow-autoloads prettier-js-autoloads
> all-the-icons-autoloads elisp-slime-nav-autoloads bundler-autoloads
> windswap-autoloads package-lint-flymake-autoloads package-lint-autoloads
> sass-mode-autoloads showtip-autoloads diminish-autoloads
> aggressive-indent-autoloads elm-test-runner-autoloads forge-autoloads
> yasnippet-snippets-autoloads yasnippet-autoloads gnuplot-autoloads
> gnu-elpa-keyring-update-autoloads cl-libify-autoloads
> bug-reference-github-autoloads git-link-autoloads dimmer-autoloads
> psci-autoloads purescript-mode-autoloads pip-requirements-autoloads
> coffee-mode-autoloads elm-mode-autoloads unfill-autoloads
> cask-mode-autoloads ledger-mode-autoloads consult-eglot-autoloads
> css-eldoc-autoloads writeroom-mode-autoloads
> visual-fill-column-autoloads haml-mode-autoloads htmlize-autoloads
> magit-todos-autoloads pcre2el-autoloads
> highlight-escape-sequences-autoloads ibuffer-vc-autoloads
> ipretty-autoloads j-mode-autoloads httprepl-autoloads
> list-unicode-display-autoloads nix-mode-autoloads
> flycheck-relint-autoloads relint-autoloads flymake-flycheck-autoloads
> rspec-mode-autoloads protobuf-mode-autoloads restclient-autoloads
> page-break-lines-autoloads shfmt-autoloads session-autoloads
> dune-autoloads pyim-autoloads nginx-mode-autoloads paredit-autoloads
> marginalia-autoloads nixpkgs-fmt-autoloads mode-line-bell-autoloads
> kind-icon-autoloads terraform-mode-autoloads hcl-mode-autoloads
> add-node-modules-path-autoloads format-all-autoloads csv-mode-autoloads
> bongo-autoloads smarty-mode-autoloads language-id-autoloads
> highlight-quoted-autoloads sudo-edit-autoloads flycheck-ledger-autoloads
> org-transclusion-autoloads yapfify-autoloads yari-autoloads
> annalist-autoloads org-cliplink-autoloads
> whitespace-cleanup-mode-autoloads psc-ide-autoloads
> ibuffer-projectile-autoloads dockerfile-mode-autoloads envrc-autoloads
> flycheck-rust-autoloads erlang-autoloads yaml-mode-autoloads
> embark-autoloads nim-mode-autoloads flycheck-nimsuggest-autoloads
> consult-flycheck-autoloads consult-autoloads svg-lib-autoloads
> move-dup-autoloads docker-autoloads aio-autoloads tuareg-autoloads
> caml-autoloads projectile-rails-autoloads rake-autoloads f-autoloads
> projectile-autoloads ruby-compilation-autoloads vlf-autoloads
> pyim-basedict-autoloads info-colors-autoloads github-review-autoloads
> a-autoloads mmm-mode-autoloads yagist-autoloads yard-mode-autoloads
> ghub-autoloads treepy-autoloads uptimes-autoloads cider-autoloads
> sesman-autoloads queue-autoloads parseedn-autoloads parseclj-autoloads
> clojure-mode-autoloads robe-autoloads inf-ruby-autoloads
> default-text-scale-autoloads org-roam-ui-autoloads websocket-autoloads
> tagedit-autoloads s-autoloads github-clone-autoloads magit-autoloads
> git-commit-autoloads with-editor-autoloads gh-autoloads
> marshal-autoloads ht-autoloads logito-autoloads pcache-autoloads
> ruby-hash-syntax-autoloads toml-mode-autoloads
> mu4e-column-faces-autoloads flycheck-nim-autoloads xref-js2-autoloads
> spinner-autoloads corfu-autoloads inheritenv-autoloads
> regex-tool-autoloads flycheck-autoloads skewer-less-autoloads
> skewer-mode-autoloads js2-mode-autoloads simple-httpd-autoloads
> color-theme-sanityinc-solarized-autoloads git-timemachine-autoloads
> auto-compile-autoloads pos-tip-autoloads yaml-autoloads
> rust-mode-autoloads typescript-mode-autoloads dhall-mode-autoloads
> posframe-autoloads org-download-autoloads async-autoloads
> sqlformat-autoloads reformatter-autoloads xr-autoloads
> markdown-mode-autoloads git-blamed-autoloads textile-mode-autoloads
> rg-autoloads wgrep-autoloads transient-autoloads org-pomodoro-autoloads
> alert-autoloads log4e-autoloads gntp-autoloads git-modes-autoloads
> org-mpv-notes-autoloads mpv-autoloads cape-autoloads
> multiple-cursors-autoloads inline-docs-autoloads vertico-autoloads
> anzu-autoloads avy-autoloads slime-autoloads macrostep-autoloads
> closql-autoloads browse-kill-ring-autoloads evil-escape-autoloads
> evil-autoloads goto-chg-autoloads which-key-autoloads pkg-info-autoloads
> epl-autoloads org-roam-autoloads magit-section-autoloads
> emacsql-sqlite-autoloads emacsql-autoloads dash-autoloads
> inflections-autoloads hl-todo-autoloads switch-window-autoloads
> vc-darcs-autoloads php-mode-autoloads epc-autoloads ctable-autoloads
> concurrent-autoloads deferred-autoloads immortal-scratch-autoloads
> command-log-mode-autoloads whole-line-or-region-autoloads
> commenter-autoloads tablist-autoloads compat-autoloads info
> company-autoloads package browse-url url url-proxy url-privacy
> url-expand url-methods url-history url-cookie generate-lisp-file
> url-domsuf url-util mailcap url-handlers url-parse auth-source eieio
> eieio-core password-cache json map byte-opt url-vars init-site-lisp
> init-utils init-benchmarking derived comp comp-cstr warnings icons
> subr-x rx cl-seq cl-macs gv cl-extra help-mode cl-loaddefs cl-lib
> bytecomp byte-compile early-init china-util rmc iso-transl tooltip cconv
> eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
> elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd
> tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
> newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
> rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
> font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
> simple cl-generic indonesian philippine cham georgian utf-8-lang
> misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
> cp51932 hebrew greek romanian slovak czech european ethiopic indian
> cyrillic chinese composite emoji-zwj charscript charprop case-table
> epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
> loaddefs theme-loaddefs faces cus-face macroexp files window
> text-properties overlay sha1 md5 base64 format env code-pages mule
> custom widget keymap hashtable-print-readable backquote threads dbusbind
> inotify dynamic-setting system-font-setting font-render-setting cairo
> gtk pgtk lcms2 multi-tty make-network-process native-compile emacs)
>
> Memory information:
> ((conses 16 1302473 371330)
>  (symbols 48 76433 15)
>  (strings 32 595811 17462)
>  (string-bytes 1 11090357)
>  (vectors 16 104288)
>  (vector-slots 8 14457574 465100)
>  (floats 8 1925 1745)
>  (intervals 56 27192 3961)
>  (buffers 984 43))

-- 
xiliuya :)