From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Brown Newsgroups: gmane.emacs.bugs Subject: bug#68664: 29.1.50; treesit defun commands broken with nested functions Date: Tue, 23 Jan 2024 09:30:49 -0500 Message-ID: References: Mime-Version: 1.0 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="7981"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68664@debbugs.gnu.org To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 23 15:32:24 2024 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 1rSHp9-0001oc-R6 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jan 2024 15:32:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSHoo-0001CS-Mb; Tue, 23 Jan 2024 09:32:02 -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 1rSHok-0001BR-2W for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 09:31:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSHoj-00022O-RW for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 09:31:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rSHoo-0008EI-0w for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 09:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Troy Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jan 2024 14:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68664 X-GNU-PR-Package: emacs Original-Received: via spool by 68664-submit@debbugs.gnu.org id=B68664.170602027631576 (code B ref 68664); Tue, 23 Jan 2024 14:32:01 +0000 Original-Received: (at 68664) by debbugs.gnu.org; 23 Jan 2024 14:31:16 +0000 Original-Received: from localhost ([127.0.0.1]:42531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSHo3-0008DE-PS for submit@debbugs.gnu.org; Tue, 23 Jan 2024 09:31:16 -0500 Original-Received: from mail-ed1-f46.google.com ([209.85.208.46]:51700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSHo0-0008D0-Tz for 68664@debbugs.gnu.org; Tue, 23 Jan 2024 09:31:14 -0500 Original-Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-55790581457so5962398a12.3 for <68664@debbugs.gnu.org>; Tue, 23 Jan 2024 06:31:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706020262; x=1706625062; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iTZ8cxH7eShes12Y7BjoaQpv9rn6spGODNxJS6qRiuo=; b=UrmZKbqPvjxB7SVOAE1mPu+BynepfAPPntFTsJtKKf7flPxquKjPoGh/YkQYkuaMbI KJpOq7CjNlR+iQupS44WQmBY0D4MtYK6CIDU0A11lkvbamt9YyASZQLp2yeJEB3W4vFK GflNbfP8ovgarNCRPdr1VqpsiVoOxBfjmp9MbPUIs//RckNZ+4kZkFrSYK3K70/0X9Au y8S6R/FYMyAbmp5qyvYo0mca5zQHPsAu/DNMOquxvh3knudtR/N6s2lfAtt7D97k7jAC 2l4homIIEWsROkDwkHb7bNyL2HhxEQm3IANj5UDx+Bkp29HKFJVmLeS158FruHk14uBW XRkQ== X-Gm-Message-State: AOJu0YwoyiH9PMildy+K0HDPhyLTfi1wqqKphWDUiQQ+IfxpkIq7MFuk p3cnyam6J/czUd3M662kocJbpHBTvWiOTmEBA3yKV0aPKpJFZctw6WB/TDMNqc/Kfxgm X-Google-Smtp-Source: AGHT+IGsnzpSAjY2DqXbcu7bo5ZpT7YTdHZtuDoq8juTdBkW3Dw/u0rRFeC27MZzk/MXn9WrKUZiXg== X-Received: by 2002:a50:a6db:0:b0:557:fe5:a682 with SMTP id f27-20020a50a6db000000b005570fe5a682mr886373edc.80.1706020261515; Tue, 23 Jan 2024 06:31:01 -0800 (PST) Original-Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com. [209.85.208.45]) by smtp.gmail.com with ESMTPSA id q20-20020aa7da94000000b00559f32cc081sm3631966eds.57.2024.01.23.06.31.00 for <68664@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Jan 2024 06:31:00 -0800 (PST) Original-Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-55a8fb31fc2so3517187a12.0 for <68664@debbugs.gnu.org>; Tue, 23 Jan 2024 06:31:00 -0800 (PST) X-Received: by 2002:a05:6402:1c0e:b0:558:d960:e2e7 with SMTP id ck14-20020a0564021c0e00b00558d960e2e7mr889397edb.40.1706020260587; Tue, 23 Jan 2024 06:31:00 -0800 (PST) In-Reply-To: X-Gmail-Original-Message-ID: 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:278739 Archived-At: On Mon, Jan 22, 2024 at 7:32=E2=80=AFPM Daniel Mart=C3=ADn wrote: > > Troy Brown writes: > > > I've noticed that "defun" related treesit commands do not appear to wor= k > > correctly when nested functions are involved. I've seen this behavior > > in multiple languages and believe the problem is an issue in the > > treesit.el library. > > Customize the treesit-defun-tactic variable to 'top-level to ignore > nested defuns in navigation commands. But I don't want it to just go to the top-level, I want it to respect the current nesting level. If I insert yet another level in the example, and point is within the second level of nesting, I want it to move to the beginning and end of = that nested function (i.e., "secondLevel" in the sample below when point is on t= he call to innerFunction). As mentioned in my original email, python-mode doe= s respect the nesting level correctly, but python-ts-mode, and other "ts" mod= es that support nesting, don't respect it. --8<---------------cut here---------------start------------->8--- # -*- mode: python-ts -*- def outerFunction(text): text =3D text def secondLevel(text): print(text) def innerFunction(text): print(text) innerFunction() def innerFunction2(text): print(text) innerFunction2() secondLevel() --8<---------------cut here---------------end--------------->8---