diff options
| author | Wilhelm H Kirschbaum | 2023-03-13 21:47:50 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-03-16 09:52:39 +0200 |
| commit | 997a8dbc48c0bfa366f74c80eb4ecd8871820ce5 (patch) | |
| tree | 667ce576698d05eeb44f52f75ca5cf33d974dc35 | |
| parent | a066487a0d47e3f9c2e871b8a27a5f025dba6f84 (diff) | |
| download | emacs-997a8dbc48c0bfa366f74c80eb4ecd8871820ce5.tar.gz emacs-997a8dbc48c0bfa366f74c80eb4ecd8871820ce5.zip | |
Fix elixir-ts-mode.elc warning (bug#62155)
* lisp/progmodes/elixir-ts-mode.el: Only require heex-ts-mode once
elixir-ts-mode loads to avoid calling (treesit-ready-p 'heex)
during byte-compilation.
| -rw-r--r-- | lisp/progmodes/elixir-ts-mode.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 136275b0f5f..286f3e39f43 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el | |||
| @@ -44,7 +44,6 @@ | |||
| 44 | ;;; Code: | 44 | ;;; Code: |
| 45 | 45 | ||
| 46 | (require 'treesit) | 46 | (require 'treesit) |
| 47 | (require 'heex-ts-mode) | ||
| 48 | (eval-when-compile (require 'rx)) | 47 | (eval-when-compile (require 'rx)) |
| 49 | 48 | ||
| 50 | (declare-function treesit-parser-create "treesit.c") | 49 | (declare-function treesit-parser-create "treesit.c") |
| @@ -480,6 +479,10 @@ | |||
| 480 | :host 'elixir | 479 | :host 'elixir |
| 481 | '((sigil (sigil_name) @name (:match "^[HF]$" @name) (quoted_content) @heex))))) | 480 | '((sigil (sigil_name) @name (:match "^[HF]$" @name) (quoted_content) @heex))))) |
| 482 | 481 | ||
| 482 | (defvar heex-ts--sexp-regexp) | ||
| 483 | (defvar heex-ts--indent-rules) | ||
| 484 | (defvar heex-ts--font-lock-settings) | ||
| 485 | |||
| 483 | (defun elixir-ts--forward-sexp (&optional arg) | 486 | (defun elixir-ts--forward-sexp (&optional arg) |
| 484 | "Move forward across one balanced expression (sexp). | 487 | "Move forward across one balanced expression (sexp). |
| 485 | With ARG, do it many times. Negative ARG means move backward." | 488 | With ARG, do it many times. Negative ARG means move backward." |
| @@ -566,8 +569,12 @@ Return nil if NODE is not a defun node or doesn't have a name." | |||
| 566 | (when (treesit-ready-p 'elixir) | 569 | (when (treesit-ready-p 'elixir) |
| 567 | ;; The HEEx parser has to be created first for elixir to ensure elixir | 570 | ;; The HEEx parser has to be created first for elixir to ensure elixir |
| 568 | ;; is the first language when looking for treesit ranges. | 571 | ;; is the first language when looking for treesit ranges. |
| 569 | (if (treesit-ready-p 'heex) | 572 | (when (treesit-ready-p 'heex) |
| 570 | (treesit-parser-create 'heex)) | 573 | ;; Require heex-ts-mode only when we load elixir-ts-mode |
| 574 | ;; so that we don't get a tree-sitter compilation warning for | ||
| 575 | ;; elixir-ts-mode. | ||
| 576 | (require 'heex-ts-mode) | ||
| 577 | (treesit-parser-create 'heex)) | ||
| 571 | 578 | ||
| 572 | (treesit-parser-create 'elixir) | 579 | (treesit-parser-create 'elixir) |
| 573 | 580 | ||