From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aleksandr Vityazev Newsgroups: gmane.emacs.help Subject: Re: Help with tree-sitter imenu settings. Date: Thu, 14 Dec 2023 14:03:12 +0300 Message-ID: <87jzphqc5r.fsf@gmail.com> References: <87zfye1alh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3962"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 12:04:02 2023 Return-path: Envelope-to: geh-help-gnu-emacs@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 1rDjVa-0000nh-5z for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 12:04:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDjUv-0003zx-QI; Thu, 14 Dec 2023 06:03:21 -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 1rDjUt-0003yN-L2 for help-gnu-emacs@gnu.org; Thu, 14 Dec 2023 06:03:19 -0500 Original-Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDjUs-0005M7-0W for help-gnu-emacs@gnu.org; Thu, 14 Dec 2023 06:03:19 -0500 Original-Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2c9e9c2989dso107319791fa.0 for ; Thu, 14 Dec 2023 03:03:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702551795; x=1703156595; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=CxJ2DRsNUiwOSKv/HzABwXSbqLsyMo/GxU3qrvL9yro=; b=jaRzkXVSU2rnH+heRMQV8prxRtAKR0Q0FWsQW/ci2wi637x81RUoI41ND0ytJflwBC yp9sbL/cd6F7nl7lyrjHbO7xMvrl7BpHN/OcV5FVxxmKIqHlo5Gdoy8Pf3CKL1TrMlIb LiLa8bh9c5WTeQnMUG1T4dq73yfobzeNky9sJywL2q7g2Qcz2ou6qxwf/dIEj7HYngG1 mvn3GGC4aTYdstGgqiYsGmRfKfYMy3Izl6e0ZDF9lHOVat1DQzzaIbMNugkAL70q0P4b RAV+YnnYAH8fsbWGu8eCFT3C54wF7xkHB29TVYH4B44JA/4psNKtaw3/m6RVl1HCG1RF vXSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702551795; x=1703156595; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CxJ2DRsNUiwOSKv/HzABwXSbqLsyMo/GxU3qrvL9yro=; b=ft6a8hn3Dbr3nOAwWpGALznTIL3Hgvr9plU/nGg1uAdlbXjNwoJQoUMcB85Y1vSwge qU03M5aXf7NhPaPyEWFUCwG1uF+sUT8l3vLb4K2QvOZVmgpCB75BnKsgQdo61aQchGoq X/jlSFaFtahja4fngaBmRjEF92IVo03LzVVbAEkxOXHg2FKfCdCn7og5ks6HH1j5lThR IEnnRF2RpxcInjXikPBdQTufFzW3/PRx07jytpltuS3aY7WlSOU7Ul8i+p4vs+OX2p3O WTS2cjASa95k529AY6uUOwaMh4Rt7XltA2hfeuerD1LR1f/28AV9R2ae9Sn7o0lxc+3/ ub1g== X-Gm-Message-State: AOJu0YwjGLmgRPcx/pWTOrOefYkyY8d+1caqUeC1H5j4NljUvrLwe4oI /q+0jnNRIKmujbRNvT1lBWHtQp439Jg= X-Google-Smtp-Source: AGHT+IH8OFEismo0qIscI9+rwcwLwuzsmvg2NrS9GzQY+Qg4tB14WX5rTdUWxdOTVO/DFUkIOpiaUw== X-Received: by 2002:a2e:9b54:0:b0:2c9:f696:450b with SMTP id o20-20020a2e9b54000000b002c9f696450bmr3533465ljj.98.1702551795392; Thu, 14 Dec 2023 03:03:15 -0800 (PST) Original-Received: from localhost ([176.59.8.210]) by smtp.gmail.com with ESMTPSA id bz12-20020a05651c0c8c00b002ca03449025sm2150865ljb.131.2023.12.14.03.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:03:15 -0800 (PST) In-Reply-To: <87zfye1alh.fsf@gmail.com> (Aleksandr Vityazev's message of "Wed, 13 Dec 2023 16:43:54 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=avityazew@gmail.com; helo=mail-lj1-x232.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145639 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I found a solution: #+begin_src elisp (defun devicetree-ts-mode--node-address (node) "Return unit addresses for NODE concanated with @." (mapconcat (lambda (children) (if (string-equal (treesit-node-field-name children) "address") (treesit-node-text children t) "")) (treesit-node-children node) "")) (defun devicetree-ts--mode--name-function (node) "Return name of NODE to use for in imenu." (let ((name (treesit-node-child-by-field-name node "name"))) (concat (treesit-node-text name t) (devicetree-ts-mode--node-address node)))) #+end_src =2D-=20 Best regards, Aleksandr Vityazev --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQT/cod8TyH8TUZ9IMTcy1JVIJi2wQUCZXrg8AAKCRDcy1JVIJi2 wag4AP0crJ9eNBP85aM2FkI6VoolGEyG/mSNUyAJaKMe4KMaSAD+MDJJBIBY0xr6 wI4G20DLzAOKoHx+fs3Bb6o8bvGu/QY= =t/rw -----END PGP SIGNATURE----- --=-=-=--