From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Qeustion about Ftreesit_pattern_expand Date: Tue, 25 Jun 2024 21:54:58 -0700 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39008"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 26 06:55:54 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sMKhG-000A1X-Jl for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Jun 2024 06:55:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMKgu-0001Gl-95; Wed, 26 Jun 2024 00:55:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMKgm-0001FY-9C for emacs-devel@gnu.org; Wed, 26 Jun 2024 00:55:24 -0400 Original-Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMKgb-0000SQ-1S for emacs-devel@gnu.org; Wed, 26 Jun 2024 00:55:23 -0400 Original-Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3d562882f4cso63692b6e.3 for ; Tue, 25 Jun 2024 21:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719377710; x=1719982510; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sIcs/KWDG9+UsPwNfMtElhzV79v0aQqNHZCZYLNkOIc=; b=OFf4AdzyekQ3qZdg7mraP1IwoR189UmT3byUKcZbd3K6wLM7NpqriF319wzgXyRVHt +FZGsAQUQTw9LOxiAf/MTwLHyTDnl3xUzqGhpLF+FCuNzMuxmc/XvPRo31BUGcq5SZVZ Kf4fwz2xDGnUPG9bM+L8FoSN/ILT+iXhIVhDDvq2Mty6bpL2D+q6GZijhFeLiy2pBboE 6yfL9VNEOfMJo4BBwJD8nJ1O8mgd2sZF4oaThCraMseTd3zEOFcY3tR1zKWSavf/Td23 +9ER60on0m7e35ylg/b67n1xw1YasGltcTlQeIxy4pNqCwOSXwjxF7s7WfvLWYdtmBIZ tk8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719377710; x=1719982510; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sIcs/KWDG9+UsPwNfMtElhzV79v0aQqNHZCZYLNkOIc=; b=VuJ/ixzEfQhKN0LZi5A8ww2RwBBtupG59oDXXVVyBCqla//4zAUkRART05KtDZr47F EU6mnihjdVMlGWVLDMxl8Wt+PNrwYRfa4qUDm1kEK2OOZbEQ+SVpGKWr5KGpscnBsytW 2au2RZUFhliejNdHpDfVj3EBokILQmzrhvt+y2sCt0kVzSXEcmFQ0JMHAa+Cma8Iad6K F01D+OvN7oF+7ama125B7l/k84NPOx9UMqaVE7ESYh31PKL+uxGVEdBLlnW23lV9v47H 0pxSuDae0R063cP88mTZwPRxVdmMq3LEbfLQ3sfeMoMp/cYvJyY7t22qGJmeLrpR1bfQ ErtQ== X-Gm-Message-State: AOJu0YzfUs4dqH5/NLmCilecoLS/ei4xuQ4jyBMVkJ2aUrjFz75NG7gT tpKx1aZAF4H3wE+jCtAjUPFEtVtZtskKjeO7Wq3Ew+2jcH2R2oEt X-Google-Smtp-Source: AGHT+IEtS+4+dxnUZqHHMdurIpwjHilqGAzx269Dthn0PbIVg2Wr0cHuBt7D+Yqm4gJt7IyOTr37cw== X-Received: by 2002:a05:6808:17a8:b0:3d5:2bb7:875 with SMTP id 5614622812f47-3d54596473dmr12064723b6e.19.1719377710178; Tue, 25 Jun 2024 21:55:10 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:3c6b:9027:64f0:9805]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7068922cd19sm4326702b3a.107.2024.06.25.21.55.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2024 21:55:09 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3774.600.62) Received-SPF: pass client-ip=2607:f8b0:4864:20::22e; envelope-from=casouri@gmail.com; helo=mail-oi1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320653 Archived-At: > On Jun 24, 2024, at 2:26=E2=80=AFPM, Gerd M=C3=B6llmann = wrote: >=20 > 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. >=20 > My question: >=20 > Function Ftreesit_pattern_expand uses this to print Lisp objects: >=20 > return Fprin1_to_string (pattern, Qnil, Qt); >=20 > where prin1 prints readably, and second arg nil means add escapes as > needed to that the result can be read back, by function read. >=20 > Why is it printing readably with escapes? >=20 > 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? >=20 Thanks for checking this Gerd. IIUC, readably is controlled by the = second argument, so it=E2=80=99s not redundant: if the second arg is = Qnil, print readably (prin1), if it=E2=80=99s Qt, print without quotes = and escapes (princ). I guess the function should=E2=80=99ve been called = print-to-string to avoid confusion. Yuan