all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Yuan Fu <casouri@gmail.com>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Qeustion about Ftreesit_pattern_expand
Date: Wed, 26 Jun 2024 07:05:45 +0200	[thread overview]
Message-ID: <m2tthgl2dy.fsf@pro2.fritz.box> (raw)
In-Reply-To: <D2F27672-2A41-4A40-B925-529B10A6FB09@gmail.com> (Yuan Fu's message of "Tue, 25 Jun 2024 21:54:58 -0700")

Yuan Fu <casouri@gmail.com> writes:

>> On Jun 24, 2024, at 2:26 PM, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
>> 
>> Not important, just as context: I wanted to see if igc works with
>> treesit Lisp objects, built with treesitter, and finally even got
>> grammars for C and C++ installed :-/. Font-locking didn't work in my
>> fork (CL packages), which I fixed.
>> 
>> My question:
>> 
>> Function Ftreesit_pattern_expand uses this to print Lisp objects:
>> 
>>  return Fprin1_to_string (pattern, Qnil, Qt);
>> 
>> where prin1 prints readably, and second arg nil means add escapes as
>> needed to that the result can be read back, by function read.
>> 
>> Why is it printing readably with escapes?
>> 
>> I know tree-sitter doesn't understand Lisp escaping because that was my
>> problem with the font-locking. Or, in other words, should the second arg
>> be Qt for don't escape?
>> 
>
> Thanks for checking this Gerd. IIUC, readably is controlled by the
> second argument, so it’s not redundant: if the second arg is Qnil,
> print readably (prin1), if it’s Qt, print without quotes and escapes
> (princ). I guess the function should’ve been called print-to-string to
> avoid confusion.

Erm, there's a misunderstanding it seems. I'm not talking about function
names or anything, I'm basically saying that the function call to
Fprin1_to_string is wrong, and its second argument should be Qt
not Qnil :-)



  reply	other threads:[~2024-06-26  5:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 21:26 Qeustion about Ftreesit_pattern_expand Gerd Möllmann
2024-06-26  4:54 ` Yuan Fu
2024-06-26  5:05   ` Gerd Möllmann [this message]
2024-06-26  5:13     ` Yuan Fu
2024-06-26  5:34       ` Gerd Möllmann
2024-06-26  6:04         ` Yuan Fu
2024-06-26  6:16           ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2tthgl2dy.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.