Subject: bug#77077: Markers in treesit_check_node

From: Juri Linkov <[email-masked]>
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?