GNU bug report logs - #59788
29.0.60; [PATCH] Make treesit-end-of-defun handle nil node

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Fri, 2 Dec 2022 20:47:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.60

Done: Yuan Fu <yuf011 <at> ucsd.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59788 in the body.
You can then email your comments to 59788 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to casouri <at> gmail.com, eliz <at> gnu.org, bug-gnu-emacs <at> gnu.org:
bug#59788; Package emacs. (Fri, 02 Dec 2022 20:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Theodor Thornhill <theo <at> thornhill.no>:
New bug report received and forwarded. Copy sent to casouri <at> gmail.com, eliz <at> gnu.org, bug-gnu-emacs <at> gnu.org. (Fri, 02 Dec 2022 20:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; [PATCH] Make treesit-end-of-defun handle nil node
Date: Fri, 02 Dec 2022 21:45:59 +0100
[Message part 1 (text/plain, inline)]
Hi Eli, Yuan and others,

mark-defun errors when node is missing in the call to goto-char.

Repro:

emacs -Q
find-file xdisp.c
M-g M-g 450 RET
M-x mark-defun

Observe that emacs is erroring.

This patch fixes this bug.  However, I notice that
treesit-beginning-of-defun returns t after it is done.  Is there a
reason for end-of-defun not to return the same?

Theo

[0001-Make-treesit-end-of-defun-handle-nil-node.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59788; Package emacs. (Sat, 03 Dec 2022 06:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 59788 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 59788 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: Re: bug#59788: 29.0.60;
 [PATCH] Make treesit-end-of-defun handle nil node
Date: Sat, 03 Dec 2022 08:33:46 +0200
> Cc: casouri <at> gmail.com, eliz <at> gnu.org
> From: Theodor Thornhill <theo <at> thornhill.no>
> Date: Fri, 02 Dec 2022 21:45:59 +0100
> 
> However, I notice that treesit-beginning-of-defun returns t after it is
> done.  Is there a reason for end-of-defun not to return the same?

The return value of end-of-defun is not documented, so it can be anything.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59788; Package emacs. (Sat, 03 Dec 2022 07:02:02 GMT) Full text and rfc822 format available.

Message #11 received at 59788 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59788 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: Re: bug#59788: 29.0.60; [PATCH] Make treesit-end-of-defun handle nil node
Date: Sat, 03 Dec 2022 08:00:17 +0100

On 3 December 2022 07:33:46 CET, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> Cc: casouri <at> gmail.com, eliz <at> gnu.org
>> From: Theodor Thornhill <theo <at> thornhill.no>
>> Date: Fri, 02 Dec 2022 21:45:59 +0100
>> 
>> However, I notice that treesit-beginning-of-defun returns t after it is
>> done.  Is there a reason for end-of-defun not to return the same?
>
>The return value of end-of-defun is not documented, so it can be anything.

Ok thanks, then I think this patch is ok now :)

Theo




Reply sent to Yuan Fu <yuf011 <at> ucsd.edu>:
You have taken responsibility. (Mon, 05 Dec 2022 06:23:01 GMT) Full text and rfc822 format available.

Notification sent to Theodor Thornhill <theo <at> thornhill.no>:
bug acknowledged by developer. (Mon, 05 Dec 2022 06:23:02 GMT) Full text and rfc822 format available.

Message #16 received at 59788-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <yuf011 <at> ucsd.edu>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: eliz <at> gnu.org, 59788-done <at> debbugs.gnu.org
Subject: Re: bug#59788: 29.0.60; [PATCH] Make treesit-end-of-defun handle  nil
 node
Date: Sun, 4 Dec 2022 22:22:41 -0800
Theodor Thornhill <theo <at> thornhill.no> writes:

> On 3 December 2022 07:33:46 CET, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>> Cc: casouri <at> gmail.com, eliz <at> gnu.org
>>> From: Theodor Thornhill <theo <at> thornhill.no>
>>> Date: Fri, 02 Dec 2022 21:45:59 +0100
>>> 
>>> However, I notice that treesit-beginning-of-defun returns t after it is
>>> done.  Is there a reason for end-of-defun not to return the same?
>>
>>The return value of end-of-defun is not documented, so it can be anything.
>
> Ok thanks, then I think this patch is ok now :)
>
> Theo

I think I applied a similar patch sent in another bug report, closing
this. Thanks as always :-)

Yuan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 02 Jan 2023 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 169 days ago.

Previous Next


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