all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#62155: 30.0.50; elixir-ts-mode.elc warning
       [not found] <877cvl9zgl.fsf.ref@yahoo.com>
@ 2023-03-13  2:06 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-03-13 11:03   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-03-13  2:06 UTC (permalink / raw)
  To: 62155


I get this building elixir-ts-mode:

  ELC      progmodes/elixir-ts-mode.elc
Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs

Would someone please DTRT?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#62155: 30.0.50; elixir-ts-mode.elc warning
  2023-03-13  2:06 ` bug#62155: 30.0.50; elixir-ts-mode.elc warning Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-03-13 11:03   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-03-13 13:08     ` Wilhelm Kirschbaum
  0 siblings, 1 reply; 6+ messages in thread
From: Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-03-13 11:03 UTC (permalink / raw)
  To: Po Lu; +Cc: 62155


Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> writes:

> I get this building elixir-ts-mode:
>
>   ELC      progmodes/elixir-ts-mode.elc
> Warning (treesit): Cannot activate tree-sitter, because tree-sitter library is not compiled with Emacs
>
> Would someone please DTRT?

Have you checked mid:83sfeat1jy.fsf@gnu.org (the end of bug#61996
thread)?  It seems that there has since been a fix to your problem.  If
even after the fix you still observe the problem, maybe Eli and Wilhelm
can chime in to help.

--
Best,


RY





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#62155: 30.0.50; elixir-ts-mode.elc warning
  2023-03-13 11:03   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-03-13 13:08     ` Wilhelm Kirschbaum
  2023-03-13 14:33       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Wilhelm Kirschbaum @ 2023-03-13 13:08 UTC (permalink / raw)
  To: Ruijie Yu; +Cc: luangruo, 62155


Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of 
text editors" <bug-gnu-emacs@gnu.org> writes:

> Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of 
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
>> I get this building elixir-ts-mode:
>>
>>   ELC      progmodes/elixir-ts-mode.elc
>> Warning (treesit): Cannot activate tree-sitter, because 
>> tree-sitter library is not compiled with Emacs
>>
>> Would someone please DTRT?
>
> Have you checked mid:83sfeat1jy.fsf@gnu.org (the end of 
> bug#61996
> thread)?  It seems that there has since been a fix to your 
> problem.  If
> even after the fix you still observe the problem, maybe Eli and 
> Wilhelm
> can chime in to help.

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.

The problem is in the top of elixir-ts-mode.el: (require 
'heex-ts-mode) and then we call
(treesit-ready-p 'heex) in heex-ts-mode. I guess the intention 
with the
convention here was to only load the -ts-mode when the user 
explicitly requires, but it
breaks the way I called (require 'heex-ts-mode) from 
elixir-ts-mode.el.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#62155: 30.0.50; elixir-ts-mode.elc warning
  2023-03-13 13:08     ` Wilhelm Kirschbaum
@ 2023-03-13 14:33       ` Eli Zaretskii
  2023-03-13 20:07         ` Wilhelm Kirschbaum
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-03-13 14:33 UTC (permalink / raw)
  To: Wilhelm Kirschbaum; +Cc: ruijie, luangruo, 62155

> Cc: luangruo@yahoo.com, 62155@debbugs.gnu.org
> From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
> 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.

> The problem is in the top of elixir-ts-mode.el: (require 
> 'heex-ts-mode) and then we call
> (treesit-ready-p 'heex) in heex-ts-mode.

Yes.

> I guess the intention with the convention here was to only load the
> -ts-mode when the user explicitly requires, but it breaks the way I
> called (require 'heex-ts-mode) from elixir-ts-mode.el.

Yes.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#62155: 30.0.50; elixir-ts-mode.elc warning
  2023-03-13 14:33       ` Eli Zaretskii
@ 2023-03-13 20:07         ` Wilhelm Kirschbaum
  2023-03-16  7:53           ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Wilhelm Kirschbaum @ 2023-03-13 20:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ruijie, luangruo, 62155

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: luangruo@yahoo.com, 62155@debbugs.gnu.org
>> From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
>> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix elixir-ts-mode.elc warning --]
[-- Type: text/x-patch, Size: 1878 bytes --]

From 07a8a8d396a91fd4b8dcb57cc98ef30784601ac3 Mon Sep 17 00:00:00 2001
From: Wilhelm H Kirschbaum <wkirschbaum@gmail.com>
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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#62155: 30.0.50; elixir-ts-mode.elc warning
  2023-03-13 20:07         ` Wilhelm Kirschbaum
@ 2023-03-16  7:53           ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2023-03-16  7:53 UTC (permalink / raw)
  To: Wilhelm Kirschbaum; +Cc: ruijie, luangruo, 62155-done

> From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
> Cc: ruijie@netyu.xyz, luangruo@yahoo.com, 62155@debbugs.gnu.org
> Date: Mon, 13 Mar 2023 22:07:27 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Cc: luangruo@yahoo.com, 62155@debbugs.gnu.org
> >> From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
> >> 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.

Thanks, installed on the master branch.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-16  7:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <877cvl9zgl.fsf.ref@yahoo.com>
2023-03-13  2:06 ` bug#62155: 30.0.50; elixir-ts-mode.elc warning Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-13 11:03   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-13 13:08     ` Wilhelm Kirschbaum
2023-03-13 14:33       ` Eli Zaretskii
2023-03-13 20:07         ` Wilhelm Kirschbaum
2023-03-16  7:53           ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.