GNU bug report logs - #60696
30.0.50; tree-sitter: node representation breaks `pp-buffer'

Previous Next

Package: emacs;

Reported by: Mickey Petersen <mickey <at> masteringemacs.org>

Date: Mon, 9 Jan 2023 22:07:02 UTC

Severity: normal

Found in version 30.0.50

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

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 60696 in the body.
You can then email your comments to 60696 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 bug-gnu-emacs <at> gnu.org:
bug#60696; Package emacs. (Mon, 09 Jan 2023 22:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mickey Petersen <mickey <at> masteringemacs.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 09 Jan 2023 22:07:02 GMT) Full text and rfc822 format available.

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

From: Mickey Petersen <mickey <at> masteringemacs.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; tree-sitter: node representation breaks `pp-buffer'
Date: Mon, 09 Jan 2023 22:01:40 +0000
Nodes appear pretty-printed like this:

     #<treesit-node 
       (block)
       in 159-173>

Because `pp-buffer' uses `downward-list' and `upward-list' to
determine list boundaries and where to line break.

The solution is to perhaps consider using a different notation than
`(block)' in the printed representation of the object. (Or make
`pp-buffer' much smarter, but that is perhaps far more work.)


In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
 3.24.20, cairo version 1.16.0) of 2023-01-02 built on mickey-work
Repository revision: c209802f7b3721a1b95113290934a23fee88f678
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.3 LTS

Configured using:
 'configure --with-native-compilation --with-json --with-mailutils
 --without-compress-install --with-imagemagick CC=gcc-10'





Reply sent to Yuan Fu <casouri <at> gmail.com>:
You have taken responsibility. (Tue, 10 Jan 2023 04:20:02 GMT) Full text and rfc822 format available.

Notification sent to Mickey Petersen <mickey <at> masteringemacs.org>:
bug acknowledged by developer. (Tue, 10 Jan 2023 04:20:02 GMT) Full text and rfc822 format available.

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

From: Yuan Fu <casouri <at> gmail.com>
To: Mickey Petersen <mickey <at> masteringemacs.org>
Cc: 60696-done <at> debbugs.gnu.org
Subject: Re: bug#60696: 30.0.50; tree-sitter: node representation breaks 
 `pp-buffer'
Date: Mon, 9 Jan 2023 20:18:55 -0800
Mickey Petersen <mickey <at> masteringemacs.org> writes:

> Nodes appear pretty-printed like this:
>
>      #<treesit-node 
>        (block)
>        in 159-173>
>
> Because `pp-buffer' uses `downward-list' and `upward-list' to
> determine list boundaries and where to line break.
>
> The solution is to perhaps consider using a different notation than
> `(block)' in the printed representation of the object. (Or make
> `pp-buffer' much smarter, but that is perhaps far more work.)

I see, and I guess using parenthesizes inside an object could break other things.
Although I like the correspondence between query syntax and printed node
type [1], it’s probably better not print parenthesizes inside an object.
Now that node is printed as #<treesit-node block in 159-173>

[1] (block) -> #<treesit-node (block) in ...>
    ";"     -> #<treesit-node ";" in ...>

Yuan




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

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

Previous Next


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