From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm H Kirschbaum Newsgroups: gmane.emacs.bugs Subject: bug#60251: 29.0.60; Consider the language at point for tree sitter treesit-inspect-node-at-point Date: Thu, 22 Dec 2022 10:42:03 +0200 Message-ID: <87lemzes0b.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32356"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 29.0.60 To: 60251@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 22 09:57:18 2022 Return-path: Envelope-to: geb-bug-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 1p8HO9-0008Fv-Pv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Dec 2022 09:57:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8HNw-0001VZ-S0; Thu, 22 Dec 2022 03:57:04 -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 1p8HNv-0001Ub-6C for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 03:57:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8HNu-0004vD-Iv for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 03:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8HNu-0004c1-Bn for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 03:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm H Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2022 08:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60251 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167169940117716 (code B ref -1); Thu, 22 Dec 2022 08:57:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Dec 2022 08:56:41 +0000 Original-Received: from localhost ([127.0.0.1]:57090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8HNY-0004bg-L6 for submit@debbugs.gnu.org; Thu, 22 Dec 2022 03:56:40 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8HNX-0004ba-41 for submit@debbugs.gnu.org; Thu, 22 Dec 2022 03:56:39 -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 1p8HNW-0001I4-Pp for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 03:56:38 -0500 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8HNV-0004nt-4x for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 03:56:38 -0500 Original-Received: by mail-wm1-x336.google.com with SMTP id bi26-20020a05600c3d9a00b003d3404a89faso3559279wmb.1 for ; Thu, 22 Dec 2022 00:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=floatpays.co.za; s=google; h=mime-version:message-id:date:subject:to:user-agent:from:from:to:cc :subject:date:message-id:reply-to; bh=c+maFTMsdAAyc9x5LeQgcBRW1c8dkpU8i25mA4FwXK8=; b=LCaOY6tDE+fo6QxKplNOmfLXxgSeXwKIHMShRzH4mjV0VUcCtlUKWirXhQEwlDSY9b oIF6oX6ewfz06Ew2lcCgW5nNcQqspynBkhsYvJ+cPSM3bs9ekv8tSi6IQGwoCXNMYd9H 4ieULzUHotBrpct0BmrVUHl8Zhf7mMkJpOgsI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:user-agent:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c+maFTMsdAAyc9x5LeQgcBRW1c8dkpU8i25mA4FwXK8=; b=2Rf6SdoCB/dJ9ugQTdiQ63p8tfcxAxmittnDdAwGnGjHSwzpVjcIGOU2BQKijGulLj pBR9cabyXNv5EwQveL1MnMbRtQVsDYxfHDiZDzv50CbdIHkNAIAegrFSa8GnLiAkHhGg ald/p9E5CcnHP6kAeyYwzHGjo49sz6Q+gLKtO223LYuI6npolKbEQEKkfghGs+B/g3nr qylB8ZLokQTzZcdzMUOcqWFWuHSu8kdgq10WgJJ5qLYpZh+sPZqy9Ys6vrPot2ZBKOXX D2+rTA3gFYrcuVXy5QudYKF0Q84czJTVm2btkV7gbzKi0y7kM4zYBxvugSZFBExH8x0F OxBg== X-Gm-Message-State: AFqh2koql6yQMsP26TiMoP74NK4qNfcLIJ5oQEd8IRXyr4vGiejsToPT f6nxe84I39cwKPRAXwcJKf3SkulCmYJV93Up X-Google-Smtp-Source: AMrXdXvQLisNn6nmDrG4mqINEqT/UmLQNK5TZQtfmp0z/MaYSfoP3YAiNqVtcbG3cMOYZDTqRiQPiw== X-Received: by 2002:a05:600c:601e:b0:3d0:7fee:8a70 with SMTP id az30-20020a05600c601e00b003d07fee8a70mr3849146wmb.19.1671699394558; Thu, 22 Dec 2022 00:56:34 -0800 (PST) Original-Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id b22-20020a05600c4e1600b003c6d21a19a0sm244270wmq.29.2022.12.22.00.56.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Dec 2022 00:56:33 -0800 (PST) X-Google-Original-From: Wilhelm H Kirschbaum Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=wilhelm@floatpays.co.za; helo=mail-wm1-x336.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, 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: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251653 Archived-At: The following change will make it possible to inspect a node when using an embedded language, otherwise it will assume the first specified language without allowing specifying the language. This assumes that treesit-language-at-point-function has been correctly set. diff --git a/lisp/treesit.el b/lisp/treesit.el index 6407669118..74dfd26776 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -1931,7 +1931,7 @@ treesit-inspect-node-at-point (interactive "p") ;; NODE-LIST contains all the node that starts at point. (let* ((node-list - (cl-loop for node = (treesit-node-at (point)) + (cl-loop for node = (treesit-node-at (point) (treesit-language-at (point))) then (treesit-node-parent node) while node if (eq (treesit-node-start node) Another option might be to allow parser-or-lang as an argument, but thinking that as an interactive function for debugging the above might be more useful, but either way it does not seem possible to inspect-node-at-point for multiple language configuration. Regards, Wilhelm