[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 aa9df1260c: Don't print named tree-sitter nodes with parenthesi
From: |
Yuan Fu |
Subject: |
emacs-29 aa9df1260c: Don't print named tree-sitter nodes with parenthesizes (bug#60696) |
Date: |
Mon, 9 Jan 2023 23:20:55 -0500 (EST) |
branch: emacs-29
commit aa9df1260c3fe5e872bef926288ce345bedbe1bb
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
Don't print named tree-sitter nodes with parenthesizes (bug#60696)
* src/print.c (print_vectorlike): Use empty string as delimiters if
the node is named.
---
src/print.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/print.c b/src/print.c
index d4a9ff8924..e65b4c40b0 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2034,8 +2034,13 @@ print_vectorlike (Lisp_Object obj, Lisp_Object
printcharfun, bool escapeflag,
/* Now the node must be up-to-date, and calling functions like
Ftreesit_node_start will not signal. */
bool named = treesit_named_node_p (XTS_NODE (obj)->node);
- const char *delim1 = named ? "(" : "\"";
- const char *delim2 = named ? ")" : "\"";
+ /* We used to use () as delimiters for named nodes, but that
+ confuses pretty-printing a tad bit. There might be more
+ little breakages here and there if we print parenthesizes
+ inside an object, so I guess better not do it.
+ (bug#60696) */
+ const char *delim1 = named ? "" : "\"";
+ const char *delim2 = named ? "" : "\"";
print_c_string (delim1, printcharfun);
print_string (Ftreesit_node_type (obj), printcharfun);
print_c_string (delim2, printcharfun);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 aa9df1260c: Don't print named tree-sitter nodes with parenthesizes (bug#60696),
Yuan Fu <=