GNU bug report logs - #61998
29.0.60; `treesit-simple-indent-presets' `prev-line' has incorrect position

Previous Next

Package: emacs;

Reported by: Troy Brown <brownts <at> troybrown.dev>

Date: Mon, 6 Mar 2023 07:52:03 UTC

Severity: normal

Found in version 29.0.60

Done: Yuan Fu <casouri <at> gmail.com>

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 <casouri <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#61998: closed (29.0.60; `treesit-simple-indent-presets'
 `prev-line' has incorrect position)
Date: Wed, 08 Mar 2023 00:29:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 7 Mar 2023 16:27:54 -0800
with message-id <D9835E42-7FBB-469A-AE72-19BB2C852E6F <at> gmail.com>
and subject line Re: bug#61998: 29.0.60; `treesit-simple-indent-presets' `prev-line'  has incorrect position
has caused the debbugs.gnu.org bug report #61998,
regarding 29.0.60; `treesit-simple-indent-presets' `prev-line' has incorrect position
to be marked as done.

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


-- 
61998: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61998
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Troy Brown <brownts <at> troybrown.dev>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60;
 `treesit-simple-indent-presets' `prev-line' has incorrect position
Date: Sun, 5 Mar 2023 23:29:59 -0500
I'm expecting `prev-line' to return the position of the first non-space
character on the previous line.  However, it instead returns the number
of characters skipped on the previous line to move to the first
non-space character (i.e., the result of calling `skip-chars-foward').

It appears there is a missing call to `point' that should appear at the
end of the defined lambda.

         (cons 'prev-line (lambda (_n _p bol &rest _)
                            (save-excursion
                              (goto-char bol)
                              (forward-line -1)
-                             (skip-chars-forward " \t"))))
+                             (skip-chars-forward " \t")
+                             (point))))


[Message part 3 (message/rfc822, inline)]
From: Yuan Fu <casouri <at> gmail.com>
To: brownts <at> troybrown.dev
Cc: 61998-done <at> debbugs.gnu.org
Subject: Re: bug#61998: 29.0.60; `treesit-simple-indent-presets' `prev-line' 
 has incorrect position
Date: Tue, 7 Mar 2023 16:27:54 -0800
Troy Brown <brownts <at> troybrown.dev> writes:

> I'm expecting `prev-line' to return the position of the first non-space
> character on the previous line.  However, it instead returns the number
> of characters skipped on the previous line to move to the first
> non-space character (i.e., the result of calling `skip-chars-foward').
>
> It appears there is a missing call to `point' that should appear at the
> end of the defined lambda.
>
>          (cons 'prev-line (lambda (_n _p bol &rest _)
>                             (save-excursion
>                               (goto-char bol)
>                               (forward-line -1)
> -                             (skip-chars-forward " \t"))))
> +                             (skip-chars-forward " \t")
> +                             (point))))

Thanks for the catch! I fixed it on emacs-29.

Yuan


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

Previous Next


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