diff options
| author | Juri Linkov | 2025-10-16 09:43:30 +0300 |
|---|---|---|
| committer | Juri Linkov | 2025-10-16 09:45:30 +0300 |
| commit | 0a4503de3a5a94fda8a81c8847a5cc4bf8bbe545 (patch) | |
| tree | 7ac345df0d9c9b0bac5246aeab90c8f64662ed28 /lisp/progmodes/python.el | |
| parent | 88c18efb3a1b9e48a5fb72b80cc7cdd5d03fa894 (diff) | |
| download | emacs-0a4503de3a5a94fda8a81c8847a5cc4bf8bbe545.tar.gz emacs-0a4503de3a5a94fda8a81c8847a5cc4bf8bbe545.zip | |
Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms
* lisp/progmodes/c-ts-mode.el:
* lisp/progmodes/cmake-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/dockerfile-ts-mode.el:
* lisp/progmodes/elixir-ts-mode.el:
* lisp/progmodes/go-ts-mode.el:
* lisp/progmodes/heex-ts-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/lua-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/rust-ts-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/progmodes/typescript-ts-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/markdown-ts-mode.el:
* lisp/textmodes/mhtml-ts-mode.el:
* lisp/textmodes/toml-ts-mode.el:
* lisp/textmodes/yaml-ts-mode.el: In autoload forms replace
'(treesit-available-p)' with (boundp 'treesit-major-mode-remap-alist).
Calling 'treesit-available-p' in loaddefs.el is too early
since the tree-sitter library might not be loaded yet.
Checking if 'treesit-major-mode-remap-alist' is bound is
equivalent to checking if Emacs is compiled with tree-sitter support.
(bug#79622)
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f06d58a6c20..5a96972caa7 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -7442,8 +7442,7 @@ implementations: `python-mode' and `python-ts-mode'." | |||
| 7442 | (derived-mode-add-parents 'python-ts-mode '(python-mode))) | 7442 | (derived-mode-add-parents 'python-ts-mode '(python-mode))) |
| 7443 | 7443 | ||
| 7444 | ;;;###autoload | 7444 | ;;;###autoload |
| 7445 | (when (and (fboundp 'treesit-available-p) (treesit-available-p) | 7445 | (when (boundp 'treesit-major-mode-remap-alist) ; Emacs 31.1 |
| 7446 | (boundp 'treesit-major-mode-remap-alist)) ; Emacs 31.1 | ||
| 7447 | (add-to-list 'treesit-major-mode-remap-alist | 7446 | (add-to-list 'treesit-major-mode-remap-alist |
| 7448 | '(python-mode . python-ts-mode))) | 7447 | '(python-mode . python-ts-mode))) |
| 7449 | 7448 | ||