From: Wilhelm H Kirschbaum Date: Mon, 13 Mar 2023 19:47:50 +0000 (+0200) Subject: Fix elixir-ts-mode.elc warning (bug#62155) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=997a8dbc48c0bfa366f74c80eb4ecd8871820ce5;p=emacs.git 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. --- 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 @@ ;;; Code: (require 'treesit) -(require 'heex-ts-mode) (eval-when-compile (require 'rx)) (declare-function treesit-parser-create "treesit.c") @@ -480,6 +479,10 @@ :host 'elixir '((sigil (sigil_name) @name (:match "^[HF]$" @name) (quoted_content) @heex))))) +(defvar heex-ts--sexp-regexp) +(defvar heex-ts--indent-rules) +(defvar heex-ts--font-lock-settings) + (defun elixir-ts--forward-sexp (&optional arg) "Move forward across one balanced expression (sexp). 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." (when (treesit-ready-p 'elixir) ;; The HEEx parser has to be created first for elixir to ensure elixir ;; is the first language when looking for treesit ranges. - (if (treesit-ready-p 'heex) - (treesit-parser-create 'heex)) + (when (treesit-ready-p 'heex) + ;; Require heex-ts-mode only when we load elixir-ts-mode + ;; so that we don't get a tree-sitter compilation warning for + ;; elixir-ts-mode. + (require 'heex-ts-mode) + (treesit-parser-create 'heex)) (treesit-parser-create 'elixir)