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: Treesitter query question, matching only substring of a node Date: Mon, 5 Dec 2022 12:45:44 -0800 Message-ID: <097583CE-DB01-4BCD-9A87-5D30E92A4F66@gmail.com> References: <87sfhvdn6k.fsf@dfreeman.email> <87o7sheure.fsf@dfreeman.email> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8827"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Danny Freeman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 05 21:46:50 2022 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 1p2IMU-00024V-0Z for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Dec 2022 21:46:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2ILj-0001b3-FQ; Mon, 05 Dec 2022 15:46:03 -0500 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 1p2ILW-0001Vy-5s for emacs-devel@gnu.org; Mon, 05 Dec 2022 15:45:51 -0500 Original-Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2ILU-0005O4-GP for emacs-devel@gnu.org; Mon, 05 Dec 2022 15:45:49 -0500 Original-Received: by mail-pl1-x633.google.com with SMTP id m4so5029040pls.4 for ; Mon, 05 Dec 2022 12:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=crOt8jyl+5pJZdBSAMF5myjkItK8EyW48Krg2orO3dc=; b=Xyh0bla/CYMgZotI42cnWaajIswr9rqGecqWwiXdVmtnOI25pq3hkVk6cUmYKuGy5w 6AjQwYP4UZyEq3FKqfpuRHnWKD68uFhdY97zGUGl4m43zxLoXYXmP8XiwbkK6BbfZzCr mhLMKaZIjh4Xl/ze3NY4GsdvvyiB1nWlWBM5Mzc+jN5kiceJElC3oXx5ik7jiqQunryx EXCBQkJxekh8GZEwVNtkPlSo979a6AEynE3i7EK8pgl+3otX1jrYs00zI355UGKTmK8Y YkkXXXTXFDziqTZOuQadmu3zFVqjks94lJc1dFK44IHP17D0qfY/M8iQMmullAJmV3XE Qk4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=crOt8jyl+5pJZdBSAMF5myjkItK8EyW48Krg2orO3dc=; b=Z0AjnbmbZaNv2DPY//uxM6XPLSQrGKDRy17bByb+3L4tDQDfhufBfRainijqu047p3 zPMMwOZAs6SrWBk436TZ527j4vjxRHofrsrubv9ITHCVQROr1zDABC4ZC+FfH0xzQalO 9DEh/gzWcbsVVKalr18lUqMOTL/5khesJ/7JaBoEsPpq52kDtTgKFPRMoL7rIZFiqoyM DTvfwzuIInNHY6gVyZnidzg7QMY1LtwTbv6kV6qPGwDw70ZwdpVpve6AmS4lZUUXBH5z szzkDAaln2VgqGQAhhwVdgbu7HdZncpHfbbUjuH1FEr8PIHVLd1E6z2K1ciyA7yPsPGB 0JMA== X-Gm-Message-State: ANoB5pmVbRsIm4nW/OLoj7VLtJq561RI3amttdCYmpAD3cKlad+wjnct pnHPl74O/5B0mRX9tq/NAzLpHd7Q+wR77g== X-Google-Smtp-Source: AA0mqf7kbQZfU+1T4tNNc0n/zgDPqcPSd/kuKcedpJo1XxObkoLPcPEFz48Kbm1Lp5RcLtpHGrLH7w== X-Received: by 2002:a17:90a:1a11:b0:213:f398:ed51 with SMTP id 17-20020a17090a1a1100b00213f398ed51mr89961339pjk.216.1670273146230; Mon, 05 Dec 2022 12:45:46 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id t68-20020a625f47000000b0056bbd286cf4sm10263971pfb.167.2022.12.05.12.45.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2022 12:45:45 -0800 (PST) In-Reply-To: <87o7sheure.fsf@dfreeman.email> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=casouri@gmail.com; helo=mail-pl1-x633.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:300940 Archived-At: > On Dec 5, 2022, at 7:25 AM, Danny Freeman = wrote: >=20 >=20 > Yuan Fu writes: >=20 >> I suggest capturing the whole node and using a function to fontify = the symbol. With a function you >> can do anything you want, including applying different faces to = substrings. To do that, simply >> define a function and use the function name as the capture name. >>=20 >> You can have a look at c-ts-mode--fontify-variable for a simple = example. >=20 > This is exactly what I was looking for. I can't believe I didn't think > of this when I was reading the documentation. >=20 > Thank you for your help! Let me know if you have ideas on how could the documentation be improved = to make it clearer. I have the curse of knowledge on me and everything = seems so easy and clear ;-)=20 Yuan=