From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum Newsgroups: gmane.emacs.bugs Subject: bug#62155: 30.0.50; elixir-ts-mode.elc warning Date: Mon, 13 Mar 2023 22:07:27 +0200 Message-ID: <87fsa8be46.fsf@gmail.com> References: <877cvl9zgl.fsf.ref@yahoo.com> <877cvl9zgl.fsf@yahoo.com> <878rg0n65g.fsf@gmail.com> <83fsa8u3f5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39582"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 Cc: ruijie@netyu.xyz, luangruo@yahoo.com, 62155@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 13 21:18:31 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pboco-0009zW-2g for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Mar 2023 21:18:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pboca-0000li-GP; Mon, 13 Mar 2023 16:18:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbocS-0000lD-5p for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2023 16:18:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pbocM-0007CI-9U for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2023 16:18:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pbocM-0004TM-28 for bug-gnu-emacs@gnu.org; Mon, 13 Mar 2023 16:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Mar 2023 20:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62155 X-GNU-PR-Package: emacs Original-Received: via spool by 62155-submit@debbugs.gnu.org id=B62155.167873864817141 (code B ref 62155); Mon, 13 Mar 2023 20:18:02 +0000 Original-Received: (at 62155) by debbugs.gnu.org; 13 Mar 2023 20:17:28 +0000 Original-Received: from localhost ([127.0.0.1]:35680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbobn-0004SP-JE for submit@debbugs.gnu.org; Mon, 13 Mar 2023 16:17:27 -0400 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:45035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbobk-0004SC-OD for 62155@debbugs.gnu.org; Mon, 13 Mar 2023 16:17:25 -0400 Original-Received: by mail-wr1-f48.google.com with SMTP id p4so6274669wre.11 for <62155@debbugs.gnu.org>; Mon, 13 Mar 2023 13:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678738638; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=L94bBpFHMMQLoJnzQIA48ShLw4XRpmsV6/rs4sIjtoc=; b=m3R1LlDM1P8UTLWYx771LvvjSndNCohzIBHxJ0eP4dxbiFKZwrfKdnV4x6sKbyDCtM BfuVFa/DJnOpCzaA3l+ofqSyv9+sd4Ry55rVNbduZvem5Itjduan4r9bfw2AL2tO4XZ8 X2QqMuj0UnH4YTfMBNkAYcd44edRmoR9p0MoYiyEbEGM3lM468RXPumZnC3QtTKeLIde tzWCopNsdOTZ0siWaE1TEbz5lsZZvJ9QgxKkWS8syFm9joyM2R3/9Pe3RZoAHvt5L8tf idfYv8jnoEz0lptGWxnKyPLD8Gd7Tnzu7LYDcQmbiFc8yn/N4e+tyPe0ihuAIs90xq02 +ZQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678738638; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=L94bBpFHMMQLoJnzQIA48ShLw4XRpmsV6/rs4sIjtoc=; b=oy9d3LZSe0SQhrSLPLYOvE0n1u0cdont1U33CvyBV/jTd8SooBcOQseRzcGI+LPgm0 EGjK03SgB7w+O+OJggXPDZgIkGP8aGCc5az6WQZMBT7KtuQqgEPGVIEZyVw6X9TvNyRT iV77EiOBsHImwhuqP0eVLchBQYsoPgiGyFTfZARN5sHw2LZFjpyDTyMKr0N8pZSdvznH CaU1xb6TO7Chf+hCL+Ugkn5E7/BDwce1mNXwQ1mdFDWbF1fOEqEXZdb4fmhd9SJRnEdo MkBvnHLeAV9YDj9jLO2iOODzlv4XZu9DcrICtdMRJKYbCWz0JkOBsCyReiD3QlwqhOe9 2DcA== X-Gm-Message-State: AO0yUKVPchDzT4CFFLw21+D363mouADPRBJVa1p7L0q4ZeN7mM0H6m2w 9nPkqDxS5O/378tV6bkq5SK4FuOmdI5fI8P6 X-Google-Smtp-Source: AK7set/RAcnOCjRjrIr58EPexfz1p1skIUQgd1ff/dp+ob92l3+iqJAsW09eqnGmdIHt85WHs9qQ6g== X-Received: by 2002:a5d:410a:0:b0:2c5:594b:10d6 with SMTP id l10-20020a5d410a000000b002c5594b10d6mr23967055wrp.29.1678738638423; Mon, 13 Mar 2023 13:17:18 -0700 (PDT) Original-Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id u7-20020a7bc047000000b003e206cc7237sm670313wmc.24.2023.03.13.13.17.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 13:17:17 -0700 (PDT) In-reply-to: <83fsa8u3f5.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257918 Archived-At: --=-=-= Content-Type: text/plain; format=flowed Eli Zaretskii writes: >> Cc: luangruo@yahoo.com, 62155@debbugs.gnu.org >> From: Wilhelm Kirschbaum >> Date: Mon, 13 Mar 2023 15:08:10 +0200 >> >> I can see there is still an issue with loading heex-ts-mode >> from >> elixir-ts-mode, but not quite sure how to >> immediately resolve it. I will have a look in a couple of >> hours. > > One possibility is to add defvar for each variable defined by > heex-ts-mode that elixir-ts-mode needs to use, and remove the > require > of heex-ts-mode. Since heex-ts-mode is loaded at run time, I > think > this should be enough. > Thank you, this seems to work well. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-elixir-ts-mode.elc-warning-bug-62155.patch Content-Description: Fix elixir-ts-mode.elc warning >From 07a8a8d396a91fd4b8dcb57cc98ef30784601ac3 Mon Sep 17 00:00:00 2001 From: Wilhelm H Kirschbaum Date: Mon, 13 Mar 2023 21:47:50 +0200 Subject: [PATCH] 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. --- lisp/progmodes/elixir-ts-mode.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 8adf647b081..da83e7d6c5a 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 @@ elixir-ts--treesit-range-rules :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 @@ elixir-ts-mode (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) -- 2.39.2 --=-=-=--