GNU bug report logs - #77077
Markers in treesit_check_node

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Juri Linkov <juri@HIDDEN>; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 31.0.50, send any further explanations to 77077 <at> debbugs.gnu.org and Juri Linkov <juri@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 77077 <at> debbugs.gnu.org:


Received: (at 77077) by debbugs.gnu.org; 22 Mar 2025 18:39:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 22 14:39:18 2025
Received: from localhost ([127.0.0.1]:45440 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tw3kc-0000df-9T
	for submit <at> debbugs.gnu.org; Sat, 22 Mar 2025 14:39:18 -0400
Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:53297)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>)
 id 1tw3ka-0000cj-6e; Sat, 22 Mar 2025 14:39:16 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 424C24433C;
 Sat, 22 Mar 2025 18:39:07 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#77077: Markers in treesit_check_node
In-Reply-To: <86plialqiu.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87zfhjtvf9.fsf@HIDDEN>
 <1C131493-80E3-4032-BB6A-E68B00692734@HIDDEN>
 <877c4l4i4y.fsf@HIDDEN> <87zfheiznv.fsf@HIDDEN>
 <86plialqiu.fsf@HIDDEN>
Date: Sat, 22 Mar 2025 20:37:49 +0200
Message-ID: <875xk052te.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheegjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopegtohhnthhrohhlseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepjeejtdejjeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegtrghsohhurhhisehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdhorhhg
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77077
Cc: casouri@HIDDEN, 77077 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

close 77077 31.0.50
thanks

>> >  (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.

So now pushed to emacs-30 and closed.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77077; Package emacs. Full text available.

Message received at 77077 <at> debbugs.gnu.org:


Received: (at 77077) by debbugs.gnu.org; 22 Mar 2025 04:02:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 22 00:02:40 2025
Received: from localhost ([127.0.0.1]:40255 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tvq4G-0000vd-Cj
	for submit <at> debbugs.gnu.org; Sat, 22 Mar 2025 00:02:40 -0400
Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:53531)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1tvq4D-0000vF-On
 for 77077 <at> debbugs.gnu.org; Sat, 22 Mar 2025 00:02:38 -0400
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-224191d92e4so52821925ad.3
 for <77077 <at> debbugs.gnu.org>; Fri, 21 Mar 2025 21:02:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742616151; x=1743220951; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=nB15Spdc9YiLoLGLqyfo86JCOODFcIojDDDmZVzWk0A=;
 b=ng+sXGStC5YMVUPk5fx6VyY/e+at3F94WVO0Z/yRGKpDpAY0Aeru7/fiRXgH4wP1jy
 nhV8neTl6X8krGOhiAvyAFNG3Tf76bLaWCnz4O9lXg5/kk/JTQLYpCXUohOgEoQTz/j7
 0U7lTlIbIAXqDnPQbY6o/Bx1NwHgXb55k8k9RR1xsDLYGbW4YzYOprjMjAYKlRV/JXKK
 /pdfLICaTZF7VvKVeOsOTR9AVN0o/ctvU3dpr6MGSBGVELTbmwb5RAaP8RXamr8/fajY
 5ElZ5OulkhOJhnVJfHxewtIKJvwHO9nRzfo4FhyuNuTAEFWTdPyUHwlnuxhfnYU3lCC1
 MeCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742616151; x=1743220951;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=nB15Spdc9YiLoLGLqyfo86JCOODFcIojDDDmZVzWk0A=;
 b=gCIFKDfSpLGFEhcKaJgnGJHjTEWIInlZP6aYaCcdzHmA+3DKAEfJik0h/wHP8MhtoK
 9hPPpPSC0XtLAN0GmUag35KUaRuScbPHUM+pW4F+C+1V+teQgkGAg6NLnbMYxE9hzNTD
 l21v7a3CrbwLDherHCqzW3yCNKLpESYWPzAuuLYHl8HJOca7GJ4JIJCB1t5qgECg5ig6
 4BSAfXHpH1ty6cxt6mUEHlbmRXoYlIGUE74k2/qb5uVQH7nT3Hk9I2dQJbGkMwq3ErcS
 LN8Z4Aydn16DVvcAY4N1b2KwqdY3RufmS92GOCr9Mo1UPnzz/FxB51mcoB6gOkwnejBk
 cAmQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCUb+k5LLVRr/7/jXaTV+Ah/QOFyrPAtGmK93PvOdUzxcrb0iABs65KWjLdSm+w8QT/QuMP3UQ==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YwOy4nA3GTBA95PZuzWOe/xdvHRtYUjd49dqrsAjGGPGwrja18X
 qM5Eok0IkzrLUpJW/OnKiWdCW1cgHKX7XcqeGiDs8s7Jfrd9EPzg
X-Gm-Gg: ASbGncuAonIouFi0gDXOyp0cYCtrUCuujPlbEzM5o81YO67Fr2ahISzTr+51lzh9JPG
 x5K8NLdJWrHnCGWM85oQZ3nl4HXNwcQpo5rOkk7SKLkDeTbntLWrq0iuT3cAR1a6Uy7VCtXMP9j
 J71XGwMArsk1AiXUSn3B9IePEtK9jqcveIpi9vIT2HW0H6Im0MG8gSLz0EJ8BajHGUd7N9lV43T
 XRfYr9qr+6NYBkDvvzWC/T0dtyAe2iyqmZtE1IcPtkDvIP+X2SV6o2T2WoOBLuSyBDvepVvRpW/
 z+F1piW8vGl8n1HIeasNbrWrbXJqR4FlWYkUKuO3sqG2v/hXzJ0MiW0D+NaNeCbvNsdCVKe14RF
 2RQI=
X-Google-Smtp-Source: AGHT+IGx2F2liCa3Chn8dJtfa9aJd5nCfoq98iF/B4MknqXIF5DjE3dCyxCFb/vPOsjsFRgw/4D26Q==
X-Received: by 2002:a17:902:f550:b0:224:26f2:97d6 with SMTP id
 d9443c01a7336-22780db4699mr104320725ad.28.1742616151519; 
 Fri, 21 Mar 2025 21:02:31 -0700 (PDT)
Received: from smtpclient.apple ([2601:646:8f81:6120:c03c:3cfe:9ba6:2116])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-7390611c8c2sm3076339b3a.107.2025.03.21.21.02.30
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 21 Mar 2025 21:02:30 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\))
Subject: Re: bug#77077: Markers in treesit_check_node
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <86plialqiu.fsf@HIDDEN>
Date: Fri, 21 Mar 2025 21:02:19 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <7536DB06-D116-4815-82FC-63CD9D4CD48B@HIDDEN>
References: <87zfhjtvf9.fsf@HIDDEN>
 <1C131493-80E3-4032-BB6A-E68B00692734@HIDDEN>
 <877c4l4i4y.fsf@HIDDEN> <87zfheiznv.fsf@HIDDEN>
 <86plialqiu.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3826.400.131.1.6)
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 77077
Cc: 77077 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)



> On Mar 21, 2025, at 1:46=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> Cc: 77077 <at> debbugs.gnu.org
>> From: Juri Linkov <juri@HIDDEN>
>> Date: Fri, 21 Mar 2025 09:57:40 +0200
>>=20
>>>> 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=E2=80=99t =
think it=E2=80=99s
>>>> a good idea to mingle them in C.
>>>=20
>>> OK, then let's fix only treesit-indent-region:
>>>=20
>>> 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
>>=20
>> Eli, is it ok to install this patch in emacs-30?
>=20
> Yes, thanks.

Thank you Juri.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77077; Package emacs. Full text available.

Message received at 77077 <at> debbugs.gnu.org:


Received: (at 77077) by debbugs.gnu.org; 21 Mar 2025 08:47:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 21 04:47:18 2025
Received: from localhost ([127.0.0.1]:34974 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tvY29-00007G-2c
	for submit <at> debbugs.gnu.org; Fri, 21 Mar 2025 04:47:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38314)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tvY1v-0008Vx-ND
 for 77077 <at> debbugs.gnu.org; Fri, 21 Mar 2025 04:47:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tvY1q-0006qW-1I; Fri, 21 Mar 2025 04:46:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=FaTWa/JrdiZG+qwPgwKgpqWurFG60HjRNfJSmaYN1Ew=; b=PfmRuyUZoPvrei8bGJIc
 iBaIHDhgDlvF7MnTNPVTeZ0VRWwdZiBiHMTwvmgcBPqowXW36R0PJDkQ4K5tcisNKrYHiY5Jy3bWE
 j9odd0wZ9PLltHRFEwoLZYCkDAqTvELokFL72XKae1olgbJ86q6C3/lqnM0tlYJiOqTOPtqpJP5Ju
 y1bYMI6Q4P9BXfFsJGe41jT8GfRGbxZpczP5I1w4a/MPFfbGNwgx3Q7+iRFmkM9FIX3Itm6gIPCrE
 wOpY3s6PSigxQkaOi+IKDzoByoGzonodWtG3/VyWcGhIwlLIsCH/N1JfwvJ7zHtQKmYHD0+l3BmdQ
 UYEIka9bvpmIlw==;
Date: Fri, 21 Mar 2025 10:46:49 +0200
Message-Id: <86plialqiu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87zfheiznv.fsf@HIDDEN> (message from Juri Linkov on
 Fri, 21 Mar 2025 09:57:40 +0200)
Subject: Re: bug#77077: Markers in treesit_check_node
References: <87zfhjtvf9.fsf@HIDDEN>
 <1C131493-80E3-4032-BB6A-E68B00692734@HIDDEN>
 <877c4l4i4y.fsf@HIDDEN> <87zfheiznv.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 77077
Cc: casouri@HIDDEN, 77077 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> Cc: 77077 <at> debbugs.gnu.org
> From: Juri Linkov <juri@HIDDEN>
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77077; Package emacs. Full text available.

Message received at 77077 <at> debbugs.gnu.org:


Received: (at 77077) by debbugs.gnu.org; 21 Mar 2025 07:59:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 21 03:59:49 2025
Received: from localhost ([127.0.0.1]:34689 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tvXID-0001qL-0q
	for submit <at> debbugs.gnu.org; Fri, 21 Mar 2025 03:59:49 -0400
Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:42201)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tvXHW-0001ju-Nj
 for 77077 <at> debbugs.gnu.org; Fri, 21 Mar 2025 03:59:08 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 2768644442;
 Fri, 21 Mar 2025 07:58:58 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#77077: Markers in treesit_check_node
In-Reply-To: <877c4l4i4y.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87zfhjtvf9.fsf@HIDDEN>
 <1C131493-80E3-4032-BB6A-E68B00692734@HIDDEN>
 <877c4l4i4y.fsf@HIDDEN>
Date: Fri, 21 Mar 2025 09:57:40 +0200
Message-ID: <87zfheiznv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-GND-State: clean
X-GND-Score: 0
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduhedtheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvvefujghofhffkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeeiffetjeegheffjeeutdeihfdukeegjeetkeeigfevueehtedvfeegkeekveekudenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedtjeejseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77077
Cc: 77077 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77077; Package emacs. Full text available.

Message received at 77077 <at> debbugs.gnu.org:


Received: (at 77077) by debbugs.gnu.org; 19 Mar 2025 07:37:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 19 03:37:50 2025
Received: from localhost ([127.0.0.1]:47252 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tunzo-0003Iu-3d
	for submit <at> debbugs.gnu.org; Wed, 19 Mar 2025 03:37:50 -0400
Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]:54883)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tunzk-0003HO-8C
 for 77077 <at> debbugs.gnu.org; Wed, 19 Mar 2025 03:37:45 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 53F3A43147;
 Wed, 19 Mar 2025 07:37:30 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#77077: Markers in treesit_check_node
In-Reply-To: <1C131493-80E3-4032-BB6A-E68B00692734@HIDDEN>
Organization: LINKOV.NET
References: <87zfhjtvf9.fsf@HIDDEN>
 <1C131493-80E3-4032-BB6A-E68B00692734@HIDDEN>
Date: Wed, 19 Mar 2025 09:23:09 +0200
Message-ID: <877c4l4i4y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-GND-State: clean
X-GND-Score: 0
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugeegjeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvvefujghofhffkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeeiffetjeegheffjeeutdeihfdukeegjeetkeeigfevueehtedvfeegkeekveekudenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejjedtjeejseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 77077
Cc: 77077 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> treesit_check_position (Lisp_Object obj, struct buffer *buf)
>> {
>> +  if (MARKERP (obj))
>> +    obj = make_fixnum (marker_position (obj));
>> +
>
> We call XFIXNUM (obj) after treesit_check_position in a lot of places. Your
> patch didn’t cause any crash?

No crashes at all.  I guess this is because of automatic conversion of
markers to integers.

> 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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77077; Package emacs. Full text available.

Message received at 77077 <at> debbugs.gnu.org:


Received: (at 77077) by debbugs.gnu.org; 19 Mar 2025 00:59:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 18 20:59:01 2025
Received: from localhost ([127.0.0.1]:44140 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tuhlp-0003Xv-Gs
	for submit <at> debbugs.gnu.org; Tue, 18 Mar 2025 20:59:00 -0400
Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:45058)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <casouri@HIDDEN>) id 1tuhle-0003VU-MD
 for 77077 <at> debbugs.gnu.org; Tue, 18 Mar 2025 20:58:53 -0400
Received: by mail-pl1-x636.google.com with SMTP id
 d9443c01a7336-22423adf751so110864485ad.2
 for <77077 <at> debbugs.gnu.org>; Tue, 18 Mar 2025 17:58:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742345920; x=1742950720; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=V90RyaPsiHrVcojSnX9lLbkCH646yF8H1MTYMYkDrlQ=;
 b=CW1JRtmKbHm0wFKDRtZO6Os9xWUxaqCCUoUxLrVTnxUQgsOjxhxcIlFm/D4Utmgo5A
 +IUa/29cmvL+HJ8tgL5qZvvd9vySwkkO2Z/gtWctwAf1wus/wlop1dEtk+EZ5XlDePcd
 IunC+I63j86aubKcVrtUJy3aoqGFpfRK++BR3gbgDVaTGzTvJxenpQm0j3G/zbCLzHlU
 JRyq6ZyAtc6a2k1mPmAV4dWe4Eu/OPgd/HYdZdVQoK/ilCXcVl/Ym+y89PlvjrsAgmtC
 e5Y64Bel5aPrclNt1aK2khxUIPj2GFxLI7ByUJBixARdGWNFQC0jFVd/Xr9kfBfo9OM9
 wwIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742345920; x=1742950720;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=V90RyaPsiHrVcojSnX9lLbkCH646yF8H1MTYMYkDrlQ=;
 b=UoNaSQHvMqKuPvU3xZg+RLOSE5/ikv8HrCyrYqMOCwh70aL1+mC1MrkRWyUZRImal7
 omRGMlRIDuCKX3NgAsNC1EgZDolsn2itimQwpFBm7JscC/XWpRxJZkx7q3b4JNIdo060
 CgQbkmUiXQFQE7vkIobJu94e9cR5shQqGCdXSBVQNU0yIyxRWLZbmINLTaK7oEfZVAMf
 ye5gBFI6DV7g4UB/eGdscG0ZwpK+G65D94TfND9aJGdoLxqMTIpGb7ENZ6A2ZL1WBmHr
 yH2W8yIOvH3ZfjgyVmOEWxUP6T+rJtZVlFAFxfu3Y6Au5Nw2zPu2pQJo1WUHtrK4J9HF
 /qGA==
X-Gm-Message-State: AOJu0YydWiu3IVrBtrjFWSh+WL3uzVkuvS0d2j//WNVjSF0SgTzikLJA
 ZNzHZiLI4ycZ4veH5cd7kaUjHBIrGvBjL6cY09SgJUxbR7RwQcYA
X-Gm-Gg: ASbGncvH5RDPoYzLhd0woxJmRtYF/nQYvl7FbRhnI1eIvCIjlcQo+8NQmsM8ewiGdiu
 dP60bv04TA3PKiCybkucdVunGZt1Dxh21ytTaj+GkAJRFlT2pDmK/AWPt6AFtlNYDoTnxokssWP
 yXUN/pGzp9YnNxvEOQ8jI8DKp/EwmTKPXNymuDZRbsdzb9rOO4QxFqtaaUKEKzGDkbZqimFh8wX
 9ULtS0YgMN2i/h+LYmjBQvYVTK6uf7eWHH3vfekl41/ynCVV6CSfCoCEjtW7OXe6qLRapFTw0Vy
 Bi2nCb9yK1DGbypD3dYv2o7nXDZ76bipwsaIWxkyKV6hFC4CHerq3nEsDpb2dJCoLNngQ7zG2jg
 483i385VH6ClAXlA6cg==
X-Google-Smtp-Source: AGHT+IHs+8GlwfXYBl/wInMJwSHVbUBxJf+vM97rl2uX6KHJPKJq2kKBYNzy4RaU7DBPTHPgnwrEYA==
X-Received: by 2002:a17:902:d2cc:b0:224:1c41:a4c0 with SMTP id
 d9443c01a7336-2264981b59bmr9380775ad.9.1742345919888; 
 Tue, 18 Mar 2025 17:58:39 -0700 (PDT)
Received: from smtpclient.apple (c-98-47-187-88.hsd1.ca.comcast.net.
 [98.47.187.88]) by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-225c6bbfff4sm101015895ad.210.2025.03.18.17.58.38
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 18 Mar 2025 17:58:39 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\))
Subject: Re: bug#77077: Markers in treesit_check_node
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <87zfhjtvf9.fsf@HIDDEN>
Date: Tue, 18 Mar 2025 17:58:27 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <1C131493-80E3-4032-BB6A-E68B00692734@HIDDEN>
References: <87zfhjtvf9.fsf@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
X-Mailer: Apple Mail (2.3826.400.131.1.6)
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 77077
Cc: 77077 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)



> On Mar 17, 2025, at 10:52=E2=80=AFAM, Juri Linkov <juri@HIDDEN> =
wrote:
>=20
> In mhtml-ts-mode activate the region, type 'C-c C-t'
> and an element name like div, type RET RET, then:
>=20
> Debugger entered--Lisp error: (wrong-type-argument integerp #<marker =
(moves after insertion) at 10 in test.html>)
>  treesit-query-capture(#<treesit-parser for html> =
#<treesit-compiled-query> 7 #<marker (moves after insertion) at 10 in =
test.html>)
>  treesit-query-range(#<treesit-parser for html> =
#<treesit-compiled-query> 7 #<marker (moves after insertion) at 10 in =
test.html> nil nil)
>  treesit--update-ranges-non-local(#<treesit-parser for html> =
#<treesit-compiled-query> javascript 32 1 7 #<marker (moves after =
insertion) at 10 in test.html> nil nil)
>  treesit--update-range-1(7 #<marker (moves after insertion) at 10 in =
test.html> #<treesit-parser for html> ...)
>  treesit-update-ranges(7 #<marker (moves after insertion) at 10 in =
test.html>)
>  treesit-indent-region(7 #<marker (moves after insertion) at 10 in =
test.html>)
>  indent-region(7 #<marker (moves after insertion) at 10 in test.html> =
nil)
>  skeleton-internal-1(n t nil)
>  skeleton-insert(... -1 nil)
>  skeleton-proxy-new(... nil nil)
>  sgml-tag(nil nil)
>  funcall-interactively(sgml-tag nil nil)
>  command-execute(sgml-tag)
>=20
> Here's the patch to fix this and it seems no more changes necessary
> since it fails only on checking, but on using it converts markers
> to numbers automatically.
>=20
> diff --git a/src/treesit.c b/src/treesit.c
> index b0979397d35..7df9bb4d0d3 100644
> --- a/src/treesit.c
> +++ b/src/treesit.c
> @@ -2190,6 +2190,9 @@ treesit_check_node (Lisp_Object obj)
> static void
> treesit_check_position (Lisp_Object obj, struct buffer *buf)
> {
> +  if (MARKERP (obj))
> +    obj =3D make_fixnum (marker_position (obj));
> +
>   treesit_check_positive_integer (obj);
>   ptrdiff_t pos =3D XFIXNUM (obj);
>   if (pos < BUF_BEGV (buf) || pos > BUF_ZV (buf))

We call XFIXNUM (obj) after treesit_check_position in a lot of places. =
Your patch didn=E2=80=99t cause any crash? 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=E2=80=99t think it=E2=80=99s a good idea to mingle =
them in C.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77077; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Mar 2025 18:00:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 17 14:00:46 2025
Received: from localhost ([127.0.0.1]:60823 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tuElY-0001mN-9J
	for submit <at> debbugs.gnu.org; Mon, 17 Mar 2025 14:00:46 -0400
Received: from lists.gnu.org ([2001:470:142::17]:58890)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tuEkP-0001Vp-CI
 for submit <at> debbugs.gnu.org; Mon, 17 Mar 2025 13:59:33 -0400
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 <juri@HIDDEN>) id 1tuEkF-0001tr-U9
 for bug-gnu-emacs@HIDDEN; Mon, 17 Mar 2025 13:59:24 -0400
Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1tuEkE-0008Uu-0m
 for bug-gnu-emacs@HIDDEN; Mon, 17 Mar 2025 13:59:23 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 1205B442A5
 for <bug-gnu-emacs@HIDDEN>; Mon, 17 Mar 2025 17:59:15 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Markers in treesit_check_node
Organization: LINKOV.NET
X-Debbugs-Cc: Yuan Fu <casouri@HIDDEN>
Date: Mon, 17 Mar 2025 19:52:27 +0200
Message-ID: <87zfhjtvf9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: 0
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddugedtudekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvufhofffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeejgffgtddthfelteejkeejueegvdekgfdufffgtdehvddtkeetveehgfffjeeuteenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepuddprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg
X-GND-Sasl: juri@HIDDEN
Received-SPF: pass client-ip=2001:4b98:dc4:8::222;
 envelope-from=juri@HIDDEN; helo=relay2-d.mail.gandi.net
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

In mhtml-ts-mode activate the region, type 'C-c C-t'
and an element name like div, type RET RET, then:

Debugger entered--Lisp error: (wrong-type-argument integerp #<marker (moves after insertion) at 10 in test.html>)
  treesit-query-capture(#<treesit-parser for html> #<treesit-compiled-query> 7 #<marker (moves after insertion) at 10 in test.html>)
  treesit-query-range(#<treesit-parser for html> #<treesit-compiled-query> 7 #<marker (moves after insertion) at 10 in test.html> nil nil)
  treesit--update-ranges-non-local(#<treesit-parser for html> #<treesit-compiled-query> javascript 32 1 7 #<marker (moves after insertion) at 10 in test.html> nil nil)
  treesit--update-range-1(7 #<marker (moves after insertion) at 10 in test.html> #<treesit-parser for html> ...)
  treesit-update-ranges(7 #<marker (moves after insertion) at 10 in test.html>)
  treesit-indent-region(7 #<marker (moves after insertion) at 10 in test.html>)
  indent-region(7 #<marker (moves after insertion) at 10 in test.html> nil)
  skeleton-internal-1(n t nil)
  skeleton-insert(... -1 nil)
  skeleton-proxy-new(... nil nil)
  sgml-tag(nil nil)
  funcall-interactively(sgml-tag nil nil)
  command-execute(sgml-tag)

Here's the patch to fix this and it seems no more changes necessary
since it fails only on checking, but on using it converts markers
to numbers automatically.

diff --git a/src/treesit.c b/src/treesit.c
index b0979397d35..7df9bb4d0d3 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -2190,6 +2190,9 @@ treesit_check_node (Lisp_Object obj)
 static void
 treesit_check_position (Lisp_Object obj, struct buffer *buf)
 {
+  if (MARKERP (obj))
+    obj = make_fixnum (marker_position (obj));
+
   treesit_check_positive_integer (obj);
   ptrdiff_t pos = XFIXNUM (obj);
   if (pos < BUF_BEGV (buf) || pos > BUF_ZV (buf))




Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
New bug report received and forwarded. Copy sent to casouri@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to casouri@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#77077; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 22 Mar 2025 18:45:02 UTC

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