GNU bug report logs - #77077
Markers in treesit_check_node

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 17 Mar 2025 18:01:02 UTC

Severity: normal

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: casouri <at> gmail.com, 77077 <at> debbugs.gnu.org
Subject: bug#77077: Markers in treesit_check_node
Date: Fri, 21 Mar 2025 10:46:49 +0200
> Cc: 77077 <at> debbugs.gnu.org
> From: Juri Linkov <juri <at> linkov.net>
> Date: Fri, 21 Mar 2025 09:57:40 +0200
> 
> >> Anyway, I think we should keep treesit_check_position as-is. And
> >> change treesit-indent-region to convert markers to integers. Integer
> >> and marker might be interchangeable in Lisp, but I don’t think it’s
> >> a good idea to mingle them in C.
> >
> > OK, then let's fix only treesit-indent-region:
> >
> > diff --git a/lisp/treesit.el b/lisp/treesit.el
> > index 46332cb1e4b..7410c0f32a8 100644
> > --- a/lisp/treesit.el
> > +++ b/lisp/treesit.el
> > @@ -2602,6 +2602,8 @@ treesit--indent-region-batch-size
> >  (defun treesit-indent-region (beg end)
> >    "Indent the region between BEG and END.
> >  Similar to `treesit-indent', but indent a region instead."
> > +  (when (markerp beg) (setq beg (marker-position beg)))
> > +  (when (markerp end) (setq end (marker-position end)))
> >    (treesit-update-ranges beg end)
> >    ;; We indent `treesit--indent-region-batch-size' lines at a time, to
> >    ;; reduce the number of times the parser needs to re-parse.  In each
> 
> Eli, is it ok to install this patch in emacs-30?

Yes, thanks.




This bug report was last modified 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.