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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Yuan Fu <yuf011 <at> ucsd.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#59788: closed (29.0.60; [PATCH] Make treesit-end-of-defun
 handle nil node)
Date: Mon, 05 Dec 2022 06:23:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 4 Dec 2022 22:22:41 -0800
with message-id <E1259C55-1E54-4893-9264-17E3A7A807B2 <at> ucsd.edu>
and subject line Re: bug#59788: 29.0.60; [PATCH] Make treesit-end-of-defun handle  nil node
has caused the debbugs.gnu.org bug report #59788,
regarding 29.0.60; [PATCH] Make treesit-end-of-defun handle nil node
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
59788: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59788
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 5 (message/rfc822, inline)]
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


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

Previous Next


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