all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tree sitter failures
       [not found] <87lelkywpd.fsf.ref@yahoo.com>
@ 2023-01-30 13:32 ` Po Lu
  2023-01-30 13:40   ` Po Lu
  2023-01-30 14:25   ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Po Lu @ 2023-01-30 13:32 UTC (permalink / raw)
  To: emacs-devel

Since some recent change the incremental build has stopped working, with
the byte-compiler complaining that it cannot find `treesit-buffer-root-node'.
I have installed this change to fix it.

But why is pcase-let or the byte compiler evaluating a binding during
macro expansion? That sounds like a bug somewhere.

diff --git a/lisp/treesit.el b/lisp/treesit.el
index c9f2e339dc2..202a383ed7d 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -86,6 +86,7 @@
 
 (declare-function treesit-search-subtree "treesit.c")
 (declare-function treesit-search-forward "treesit.c")
+(declare-function treesit-subtree-stat "treesit.c")
 (declare-function treesit-induce-sparse-tree "treesit.c")
 
 (declare-function treesit-available-p "treesit.c")
@@ -265,12 +266,14 @@ treesit-buffer-root-node
 Use the first parser in the parser list if LANGUAGE is omitted.
 If LANGUAGE is non-nil, use the first parser for LANGUAGE in the
 parser list, or create one if none exists."
-  (if-let ((parser
-            (if language
-                (treesit-parser-create language)
-              (or (car (treesit-parser-list))
-                  (signal 'treesit-no-parser (list (current-buffer)))))))
-      (treesit-parser-root-node parser)))
+  ;; Otherwise the incremental build is broken without tree-sitter.
+  (when (treesit-available-p)
+    (if-let ((parser
+              (if language
+                  (treesit-parser-create language)
+                (or (car (treesit-parser-list))
+                    (signal 'treesit-no-parser (list (current-buffer)))))))
+        (treesit-parser-root-node parser))))
 
 (defun treesit-filter-child (node pred &optional named)
   "Return children of NODE that satisfies predicate PRED.



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

* Re: tree sitter failures
  2023-01-30 13:32 ` tree sitter failures Po Lu
@ 2023-01-30 13:40   ` Po Lu
  2023-01-30 14:25   ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Po Lu @ 2023-01-30 13:40 UTC (permalink / raw)
  To: emacs-devel

Po Lu <luangruo@yahoo.com> writes:

> Since some recent change the incremental build has stopped working, with
> the byte-compiler complaining that it cannot find `treesit-buffer-root-node'.
> I have installed this change to fix it.
>
> But why is pcase-let or the byte compiler evaluating a binding during
> macro expansion? That sounds like a bug somewhere.

BTW, I hope this stuff doesn't affect the release branch, because if bugs
like these affect Emacs 29, then I guess it would be safer to postpone
the pretest until bugs introduced by tree-sitter are ironed out...



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

* Re: tree sitter failures
  2023-01-30 13:32 ` tree sitter failures Po Lu
  2023-01-30 13:40   ` Po Lu
@ 2023-01-30 14:25   ` Eli Zaretskii
  2023-01-30 14:35     ` Po Lu
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2023-01-30 14:25 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Date: Mon, 30 Jan 2023 21:32:30 +0800
> 
> Since some recent change the incremental build has stopped working, with
> the byte-compiler complaining that it cannot find `treesit-buffer-root-node'.
> I have installed this change to fix it.

On which branch?

Are you sure this wasn't due to the same bug I fixed a few minutes ago
in treesit.el?

> But why is pcase-let or the byte compiler evaluating a binding during
> macro expansion? That sounds like a bug somewhere.

I don't think this happens.  Please undo the change and show the error
message.



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

* Re: tree sitter failures
  2023-01-30 14:25   ` Eli Zaretskii
@ 2023-01-30 14:35     ` Po Lu
  2023-01-30 18:30       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Po Lu @ 2023-01-30 14:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> On which branch?
>
> Are you sure this wasn't due to the same bug I fixed a few minutes ago
> in treesit.el?

I think it was, and we tried to fix the same bug at the same time.  What
an unusual coincidence.  Please feel free to undo my change.

Thanks.



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

* Re: tree sitter failures
  2023-01-30 14:35     ` Po Lu
@ 2023-01-30 18:30       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2023-01-30 18:30 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Mon, 30 Jan 2023 22:35:56 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > On which branch?
> >
> > Are you sure this wasn't due to the same bug I fixed a few minutes ago
> > in treesit.el?
> 
> I think it was, and we tried to fix the same bug at the same time.  What
> an unusual coincidence.  Please feel free to undo my change.

Done.



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

end of thread, other threads:[~2023-01-30 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87lelkywpd.fsf.ref@yahoo.com>
2023-01-30 13:32 ` tree sitter failures Po Lu
2023-01-30 13:40   ` Po Lu
2023-01-30 14:25   ` Eli Zaretskii
2023-01-30 14:35     ` Po Lu
2023-01-30 18:30       ` 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.