unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#60696: 30.0.50; tree-sitter: node representation breaks `pp-buffer'
@ 2023-01-09 22:01 Mickey Petersen
  2023-01-10  4:18 ` Yuan Fu
  0 siblings, 1 reply; 2+ messages in thread
From: Mickey Petersen @ 2023-01-09 22:01 UTC (permalink / raw)
  To: 60696


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'






^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#60696: 30.0.50; tree-sitter: node representation breaks  `pp-buffer'
  2023-01-09 22:01 bug#60696: 30.0.50; tree-sitter: node representation breaks `pp-buffer' Mickey Petersen
@ 2023-01-10  4:18 ` Yuan Fu
  0 siblings, 0 replies; 2+ messages in thread
From: Yuan Fu @ 2023-01-10  4:18 UTC (permalink / raw)
  To: Mickey Petersen; +Cc: 60696-done


Mickey Petersen <mickey@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-10  4:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 22:01 bug#60696: 30.0.50; tree-sitter: node representation breaks `pp-buffer' Mickey Petersen
2023-01-10  4:18 ` Yuan Fu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).