From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: casouri@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Dec 2022 10:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 60197@debbugs.gnu.org Cc: casouri@gmail.com X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: casouri@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.167144480313118 (code B ref -1); Mon, 19 Dec 2022 10:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Dec 2022 10:13:23 +0000 Received: from localhost ([127.0.0.1]:38172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7D99-0003PW-IF for submit@debbugs.gnu.org; Mon, 19 Dec 2022 05:13:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:38754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7D98-0003PQ-BA for submit@debbugs.gnu.org; Mon, 19 Dec 2022 05:13:22 -0500 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 1p7D97-0000AP-Ma for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 05:13:22 -0500 Received: from out-253.mta0.migadu.com ([91.218.175.253]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7D95-0005Ue-PW for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2022 05:13:21 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671444797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=CV1iXiFEVJFF/hfQ4IsYO9Ie4BDbwJ8l86kzcGboyJ8=; b=NGRV3msSlK5Syvj/W2LNKv6zZXmJC6MNa8jfPA47i0R/Hod70iwSNX1is54SsADz/MsKyH /FnK4m4sOJUvt2e/BXWnHaTUEigWSjBqONihNBh3Ois+NmJ0um6VT9V64iztPPfBA+9I3J nsb4PBYcyCHsK4sLmk86QnZPZPs2PjcuIohefdXbmDcT2rYcs0FgpraNkmPx3qZCq0KNeO iExM+ZLBhna/3DlHQMuT+BeI9axrl3z4Bl6pWkGeyd+CDkJw2Co1QhWAuxLQkC4rLpOohJ 2HgrNVOKooJOFl+bv6r8fw05Ulzi2JdvY58p8VWmObWJHEgqMxwtbgPFtyXr9g== From: Theodor Thornhill Date: Mon, 19 Dec 2022 11:13:15 +0100 Message-ID: <87edsv7lc4.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.253; envelope-from=theo@thornhill.no; helo=out-253.mta0.migadu.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi, Yuan! It seems 'prog-fill-reindent-defun' is broken after the latest changes to treesit-beginning-of-defun. The culprit is that we now use remap instead of setting the beginning-of-defun-function. What is the reasoning behind that change? Can't we just rely on the variable beginning-of-defun-function? I see you mentioned it is inteded to be used as a command, but surely both should be possible? Theo From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Dec 2022 08:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 60197@debbugs.gnu.org Cc: casouri@gmail.com Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.1671525155808 (code B ref 60197); Tue, 20 Dec 2022 08:33:02 +0000 Received: (at 60197) by debbugs.gnu.org; 20 Dec 2022 08:32:35 +0000 Received: from localhost ([127.0.0.1]:43382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Y38-0000Cy-F3 for submit@debbugs.gnu.org; Tue, 20 Dec 2022 03:32:35 -0500 Received: from out-220.mta0.migadu.com ([91.218.175.220]:29814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7Y33-0000Cs-5X for 60197@debbugs.gnu.org; Tue, 20 Dec 2022 03:32:33 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671525147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iNkLWXIS0p4cdNyEIl3jE6mEa8HB/CVBKnbzTi6cY9E=; b=QbeulElqRW/d0uF0TVF00DPqXzjKglP6UPAg/8VUKNf5DuXkUdxX+TUTB5ye6+nkTLRAAS aUUoGJFp6hlbibhyDrXZBYCSomhjufYTJHqoMz+W5MTHI30bC9QXOv/64bVD6g7qESwy5/ nGRmhbpQF7s6kbvkb6HMlE1aBT/kRYNj43fa+9BG1YfhiY4zQF2uRMHkpXkSNX9P+AjaDY 31kbPTDb3SEPJ3+939urtqSvgG7Ovhz41i1ldToSUpF9f3COOqXUGN/5K0AYzBjCFmgowF chilru/jjSK/kmMyuMV6F74b+bAQ9AVV1o4ab21QCqjONKNa8ZwvadisSX0sog== From: Theodor Thornhill In-Reply-To: <87edsv7lc4.fsf@thornhill.no> (Theodor Thornhill's message of "Mon, 19 Dec 2022 11:13:15 +0100") References: <87edsv7lc4.fsf@thornhill.no> Date: Tue, 20 Dec 2022 09:32:23 +0100 Message-ID: <874jtq79wo.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Theodor Thornhill writes: > Hi, Yuan! > > It seems 'prog-fill-reindent-defun' is broken after the latest changes > to treesit-beginning-of-defun. The culprit is that we now use remap > instead of setting the beginning-of-defun-function. What is the > reasoning behind that change? Can't we just rely on the variable > beginning-of-defun-function? > > I see you mentioned it is inteded to be used as a command, but surely > both should be possible? > This will also affect things like mark-defun and friends. Should I prepare a patch to fix this? Theo From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl References: <87edsv7lc4.fsf@thornhill.no> In-Reply-To: <87edsv7lc4.fsf@thornhill.no> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Dec 2022 04:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.16715957003329 (code B ref 60197); Wed, 21 Dec 2022 04:09:02 +0000 Received: (at 60197) by debbugs.gnu.org; 21 Dec 2022 04:08:20 +0000 Received: from localhost ([127.0.0.1]:49094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7qOx-0000rd-RG for submit@debbugs.gnu.org; Tue, 20 Dec 2022 23:08:20 -0500 Received: from mail-pl1-f172.google.com ([209.85.214.172]:45893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7qOw-0000rX-Ey for 60197@debbugs.gnu.org; Tue, 20 Dec 2022 23:08:18 -0500 Received: by mail-pl1-f172.google.com with SMTP id w20so7747760ply.12 for <60197@debbugs.gnu.org>; Tue, 20 Dec 2022 20:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=C4496P28hXlTFosdZOr/vVtHXQHwLLsxhV809I/hgoc=; b=Viaj6tediz4Uo47bPJkcSoJEtG6jjauOHo/kaKZhxxAidZJTE97zSxfg8pFtBF2Nbl 8e+u1EWI/5SMcCfYXXR9yY78/CodriFBqbXV7bnberEdZ7LvR9tZ/fa30dADIsAF8HCm QQPajSTsMD78DwKwZfxDoJp+AUQjab2qltWa944ibl7nXlA1xz1TkfbA7FJunPwbBQb8 59fSi4NP3vZbuwMjK9R5KLj3XPhFiSCnG/2LEDOoGH8ckCCQzSxRcXV2ytOy4kiENguk l5x0BipAUGouunANmpfGM/HoufQVAyTqb7WIku/pLGPp9UDZiZsTib6/JypUi0YBOYip 6DWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C4496P28hXlTFosdZOr/vVtHXQHwLLsxhV809I/hgoc=; b=netWXMrUngu98Ijpx9uM2LXxkPwVGBhx4KZuZs0WAXF4TchdLniW+3e0qu8/mSHYTh sKBGylcVml3eWYINOY023qKHeG6zlb3f6vSXnN5hn9oRHG0KJZgaZFu5798dPqF0tS/G 8e7b1d6R7Z6wM2dRKQ6jDndoH80CRgtMGEu3GXTXKTzQqsQyOO9Nt4nZOHMUz71DlmT2 yPMtGPEYFGfPuhj+UPVUicxlvYgbGygARW+ImIgA3GLvS3By9rEC5VdCETc2KPZrP6Fi AiVYVFPN00HOZNc+t9HY3zR2PzowXq+SAvoBH8j+BL+0a3VFstrFW6GO61siJApCKqDc IvDQ== X-Gm-Message-State: AFqh2kok+ZHq7j2sqA6YxzHec391qwmMbfvRioOlOjBr4XMqFLK3CO7T QwSz4lT0S8WSBwflnai/qek= X-Google-Smtp-Source: AMrXdXvEPBbGDKIfyKhhB3kAVb3mAqb3ykxYmBEp1GpRe3jlBb9o6nCosDwR7OgW9KV8EDgM4ak82w== X-Received: by 2002:a17:90b:8d1:b0:219:6c99:828 with SMTP id ds17-20020a17090b08d100b002196c990828mr730625pjb.0.1671595692440; Tue, 20 Dec 2022 20:08:12 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id a16-20020a17090a6d9000b00223fa0148b8sm304691pjk.41.2022.12.20.20.08.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2022 20:08:12 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Message-Id: <9AC22A2A-6ED8-4778-95CE-EB29A7FC4633@gmail.com> Date: Tue, 20 Dec 2022 20:08:09 -0800 X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Theodor Thornhill writes: > Hi, Yuan! > > It seems 'prog-fill-reindent-defun' is broken after the latest changes > to treesit-beginning-of-defun. The culprit is that we now use remap > instead of setting the beginning-of-defun-function. What is the > reasoning behind that change? Can't we just rely on the variable > beginning-of-defun-function? Not really, end-of-defun uses beginning/end-of-defun-function in a way that=E2=80=99s incompatible with nested defuns[1]. So if we want to = support navigation nested defuns reliably we need to remap the commands instead. In the future (ie emacs 30), we can extend the current beginning/end-of-defun to support nested defuns, then we don=E2=80=99t = need to remap the commands anymore. > I see you mentioned it is inteded to be used as a command, but surely > both should be possible? Could you remind me where is this function defined? I should have updated it when I changed the defun navigation implementation. (It was broken by my change before the defun nav change which you noticed, I thought I=E2=80=99m going to fix it with the new defun nav functions, = but I forgot...) Yuan [1] For example, a nested defun like this: def parent: (1) def child: return 0 (2) return 1 (3) When point is at (1), end-of-defun calls beginning-of-defun-function followed by end-of-defun-function to check if point is in a defun: if point ends up after the starting point, then starting point is inside a defun, and we can stop there. In this case, point ends up at (3), because b-o-d-f goes to previous b-o-d, which is the beg of parent, then e-o-d-f goes to (3), which is the end of that parent, and end-of-defun stops at (3). However, we should have gone to (2), which is the immediately following end-of-defun. Thanks, Yuan From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Dec 2022 06:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.16716023448193 (code B ref 60197); Wed, 21 Dec 2022 06:00:02 +0000 Received: (at 60197) by debbugs.gnu.org; 21 Dec 2022 05:59:04 +0000 Received: from localhost ([127.0.0.1]:49594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7s87-000285-IM for submit@debbugs.gnu.org; Wed, 21 Dec 2022 00:59:03 -0500 Received: from out-151.mta0.migadu.com ([91.218.175.151]:37927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7s85-00027i-Pw for 60197@debbugs.gnu.org; Wed, 21 Dec 2022 00:59:02 -0500 Date: Wed, 21 Dec 2022 06:58:53 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671602339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fNsLZJM75yV7EKn5mGZmtn5stUzxIfGPArfOVH6aOo0=; b=1F3AvyO4z525weYS6lAkyTJQlZuR8U4slElHhCoGVuRxndrHqQtaqQ00v79r2RjStEaUBE aSCvwLBON+1AwXEn02I2CW6Bh1ZaYAPvb/MibhVMpQ73l1T6kB8IWHQnH5q36nPl+nyrpH +Z/HmQtfquDv4WacXMPDmpaHhDuDj1Do8Jnf6Cjc8LbWoLg9K0kHpVgXgo8zdxa66RkZUX VMEK5SHQBsZZ6z3hJHzsFdzHf59i82uLz5HRSv3+xE7kEuRZudaECP33X8jMAvOZwhofYz nbvJ3GXULy2LZJZUQmosSv5ziFrIwMePiNvtp/A9oK+bkA+jixH/LO8b16e3CA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill In-Reply-To: <9AC22A2A-6ED8-4778-95CE-EB29A7FC4633@gmail.com> References: <9AC22A2A-6ED8-4778-95CE-EB29A7FC4633@gmail.com> Message-ID: <2D3D9864-F4F4-4AB2-A88D-5FD0919AEF12@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 21 December 2022 05:08:09 CET, Yuan Fu wrote: > >Theodor Thornhill writes: > >> Hi, Yuan! >> >> It seems 'prog-fill-reindent-defun' is broken after the latest changes >> to treesit-beginning-of-defun=2E The culprit is that we now use remap >> instead of setting the beginning-of-defun-function=2E What is the >> reasoning behind that change? Can't we just rely on the variable >> beginning-of-defun-function? > >Not really, end-of-defun uses beginning/end-of-defun-function in a way >that=E2=80=99s incompatible with nested defuns[1]=2E So if we want to sup= port >navigation nested defuns reliably we need to remap the commands instead= =2E >In the future (ie emacs 30), we can extend the current >beginning/end-of-defun to support nested defuns, then we don=E2=80=99t ne= ed to >remap the commands anymore=2E > >> I see you mentioned it is inteded to be used as a command, but surely >> both should be possible? > >Could you remind me where is this function defined? I should have >updated it when I changed the defun navigation implementation=2E (It was >broken by my change before the defun nav change which you noticed, I >thought I=E2=80=99m going to fix it with the new defun nav functions, but= I >forgot=2E=2E=2E) > >Yuan > It is in prog-mode=2Eel, in the master branch=2E But the biggest issue now= is that every function or command that relies on beginning-of-defun and e= nd-of-defun is broken=2E=20 > >[1] For example, a nested defun like this: > >def parent: > (1) > def child: > return 0 >(2) return 1 >(3) > >When point is at (1), end-of-defun calls beginning-of-defun-function >followed by end-of-defun-function to check if point is in a defun: if >point ends up after the starting point, then starting point is inside a >defun, and we can stop there=2E In this case, point ends up at >(3), because b-o-d-f goes to previous b-o-d, which is the beg of parent, >then e-o-d-f goes to (3), which is the end of that parent, and >end-of-defun stops at (3)=2E > >However, we should have gone to (2), which is the immediately following >end-of-defun=2E > That depends on the tactic chosen, right? >Thanks, >Yuan Are you sure this isn't compatible? From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl References: <87edsv7lc4.fsf@thornhill.no> In-Reply-To: <87edsv7lc4.fsf@thornhill.no> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Dec 2022 06:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.167160541411031 (code B ref 60197); Wed, 21 Dec 2022 06:51:02 +0000 Received: (at 60197) by debbugs.gnu.org; 21 Dec 2022 06:50:14 +0000 Received: from localhost ([127.0.0.1]:49838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7sve-0002rq-3P for submit@debbugs.gnu.org; Wed, 21 Dec 2022 01:50:14 -0500 Received: from mail-pl1-f181.google.com ([209.85.214.181]:33413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7svc-0002ri-Fd for 60197@debbugs.gnu.org; Wed, 21 Dec 2022 01:50:13 -0500 Received: by mail-pl1-f181.google.com with SMTP id 17so14696095pll.0 for <60197@debbugs.gnu.org>; Tue, 20 Dec 2022 22:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=awE6Jh7RYtG087wk6fLC2RICqut+wwGbJ8Ky+Vbqgso=; b=KDsIk1nLytQJyh9ibAQ2/nu9PQv3hEtPnT7xcLMjhMSijHAwaoAIrmfAlOMy6nw41m OrLDTII2N4CT44Cl4tLAJN6i34xSje5vJ/Tye2Qqs7CzX2OT3/NHfe20Cq+wxHFHYdaJ SPM/qIZrT7k9boDejcIp90XtcKvbrKTV0jMzfjRvRzFlQlEncbJK/62ljdcK6yAxSQJj KboFysVxnkEVEMBdh/hdO6GI/dBRy3OW8P1VfjjYXoz7fM3nAHtiMBsaTEVW3kGS3g0P QE7QrO3LMxKvYoMXyQpG2zhARCzsDYmOx9K65P1+YKyZIiL8xPUjVpl7sE0Ul26rEIFC 29rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=awE6Jh7RYtG087wk6fLC2RICqut+wwGbJ8Ky+Vbqgso=; b=PAmXwue5DBwlB/ALs4PKM+cIji0pia85FSkLFmOt84SQ5UA9rS3aPtCoPpK4I6cHiM F3fG3irwuPAM/n9OD3VjvB26DdkNRgg9O1LKw/ieYkGIasBDo08JvhuA/Kv31vcZpNQy a9Z2SluCPzfrrJWQKJLWvRdYpWB8eQFYslvr26gDvZl/APYEKOwwOpA7QjP0r6zNZrIX P0ojv7Yh9E7LYurWqaQI0JjW2RD5uA6HH9NoDNNelIkP/tU0KHegoNZfGd/gnJmfkHCX K9inF+0koBAhUn1XevBMxIgP/J7akkSxMaSu83OwCjLyvIrQJ98QUOchQklsLzBThq8r GINA== X-Gm-Message-State: AFqh2krKbOptFm191DWSSaLKa2jnLQyzCZT6WSKitByms63aeKUKcs/w WsgHJPBdYAuRPTgOuR9NU/E= X-Google-Smtp-Source: AMrXdXuC0nNkeb4HSbAK30xHr20LVTLlmF3WMbXLYBB95PqMtakWhnzncQpTGPoQTE2NdQg6Sbjq9g== X-Received: by 2002:a17:902:6bca:b0:189:d8fb:152d with SMTP id m10-20020a1709026bca00b00189d8fb152dmr723219plt.25.1671605406360; Tue, 20 Dec 2022 22:50:06 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id b12-20020a170903228c00b00186c3afb49esm10556827plh.209.2022.12.20.22.50.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2022 22:50:05 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Message-Id: <7C88E19F-63AC-4551-AC06-D2B067990A5A@gmail.com> Date: Tue, 20 Dec 2022 22:50:04 -0800 X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yuan Fu writes: > Theodor Thornhill writes: > >> Hi, Yuan! >> >> It seems 'prog-fill-reindent-defun' is broken after the latest = changes >> to treesit-beginning-of-defun. The culprit is that we now use remap >> instead of setting the beginning-of-defun-function. What is the >> reasoning behind that change? Can't we just rely on the variable >> beginning-of-defun-function? > > Not really, end-of-defun uses beginning/end-of-defun-function in a way > that=E2=80=99s incompatible with nested defuns[1]. So if we want to = support > navigation nested defuns reliably we need to remap the commands = instead. > In the future (ie emacs 30), we can extend the current > beginning/end-of-defun to support nested defuns, then we don=E2=80=99t = need to > remap the commands anymore. I see the problem now... Many other functions uses beginning/end-of-defun. I didn=E2=80=99t thought about that initially = :-( But I don=E2=80=99t want to make big changes to beg/end-of-deun, hmmm. Yuan From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Dec 2022 07:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.167160857113016 (code B ref 60197); Wed, 21 Dec 2022 07:43:01 +0000 Received: (at 60197) by debbugs.gnu.org; 21 Dec 2022 07:42:51 +0000 Received: from localhost ([127.0.0.1]:50103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7tkZ-0003Ns-HQ for submit@debbugs.gnu.org; Wed, 21 Dec 2022 02:42:51 -0500 Received: from out-156.mta0.migadu.com ([91.218.175.156]:57100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7tkX-0003Nm-9G for 60197@debbugs.gnu.org; Wed, 21 Dec 2022 02:42:50 -0500 Date: Wed, 21 Dec 2022 08:42:38 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671608566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4ZEWqFU8TnPDm0DOUkk6aVrdd37d2TdNrjzBQFVHHlQ=; b=boHINsfGwu6uA3L4DTfzRfJnutrYE63QAbnp+VA9JcxmjQ9oMf1bqdnM3iWEpel+pgau/D gl2v0pVAJvgSZMMHSkhyTWszt7vj+Qx+CYn3WsrdcNHcDenyRNy2wb8XNShpd2Wk7uN51c hnNMWRxXx+FjWP2zT8nvGCRF40m0FoJTeWPzaLOhzqBIb6OygpvTRWCTsOsfAMekayuwW1 czT1e7qebiXKc1yK6ZW0Tuy6cjB6TROM3uAqlm9YekOuePaov9tLRffLj536tlQ0i0kOmf OWfHakdCcXBZyK8Z4gwQx9aubIyRmDdTjh2h7/DqDpMIg/oelQu5mEK72wwdWw== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill In-Reply-To: <7C88E19F-63AC-4551-AC06-D2B067990A5A@gmail.com> References: <7C88E19F-63AC-4551-AC06-D2B067990A5A@gmail.com> Message-ID: <81D7EE3A-4548-40FF-9644-391738DFF145@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 21 December 2022 07:50:04 CET, Yuan Fu wrote: > >Yuan Fu writes: > >> Theodor Thornhill writes: >> >>> Hi, Yuan! >>> >>> It seems 'prog-fill-reindent-defun' is broken after the latest changes >>> to treesit-beginning-of-defun=2E The culprit is that we now use remap >>> instead of setting the beginning-of-defun-function=2E What is the >>> reasoning behind that change? Can't we just rely on the variable >>> beginning-of-defun-function? >> >> Not really, end-of-defun uses beginning/end-of-defun-function in a way >> that=E2=80=99s incompatible with nested defuns[1]=2E So if we want to s= upport >> navigation nested defuns reliably we need to remap the commands instead= =2E >> In the future (ie emacs 30), we can extend the current >> beginning/end-of-defun to support nested defuns, then we don=E2=80=99t = need to >> remap the commands anymore=2E > >I see the problem now=2E=2E=2E Many other functions uses >beginning/end-of-defun=2E I didn=E2=80=99t thought about that initially := -( > >But I don=E2=80=99t want to make big changes to beg/end-of-deun, hmmm=2E > >Yuan I think you can set the functions and remap, right? Maybe you can force th= e beginning-of-defun-function variant to choose the smallest scope as a def= ault? Or just follow the same tactic the user set? Theo From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl References: <87edsv7lc4.fsf@thornhill.no> In-Reply-To: <87edsv7lc4.fsf@thornhill.no> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2022 05:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.16716852555902 (code B ref 60197); Thu, 22 Dec 2022 05:01:02 +0000 Received: (at 60197) by debbugs.gnu.org; 22 Dec 2022 05:00:55 +0000 Received: from localhost ([127.0.0.1]:55960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8DhO-0001X8-La for submit@debbugs.gnu.org; Thu, 22 Dec 2022 00:00:54 -0500 Received: from mail-pl1-f169.google.com ([209.85.214.169]:46833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8DhM-0001X0-3f for 60197@debbugs.gnu.org; Thu, 22 Dec 2022 00:00:53 -0500 Received: by mail-pl1-f169.google.com with SMTP id jn22so915536plb.13 for <60197@debbugs.gnu.org>; Wed, 21 Dec 2022 21:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=1pNmVNg6y6UyYIcxSIBFRyD1gzHk+UaPysfkQH47UqQ=; b=O0tMtIwqzl6peGxVufp5e0r1kpUlotZG1xDMIq6EUQDl7vcB64nvE7Zp710or/DVL/ kOzv+yWOF2SqZYYQjEOhdF2PPpbhnqceh8idDyMQroQqOyKAWkteNbrhcsNQct0Rj4Tl CWdGWHVK69dGB56vZl1cPSK0uNF5Pd0Eh1rda0mXU1oO+B3YTtKem1ebLPW5LtAqg4gV G7585GqMtxLwQrozNakCDZ+r4Ya/zfgJSK2fHg9NeKS/THFrBg6XOueM0HYssYE2360i tpLO6WPcPmGXB6jofgOF5Y73dtOIl6U2TRivqKl4EXKBFAal1fhL/oZ+wWRTZsDcIFgd Kesg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1pNmVNg6y6UyYIcxSIBFRyD1gzHk+UaPysfkQH47UqQ=; b=JK3a1SAjzeP/Qy7I/lzLoewUb7xaP8qTbVikYWCk6FSziMhTCQYMfS4hbnVtr8lMGk NlK23nOobtbKxPHrlN0PORZTAPfPCzzhG1Z0tMC2w0vGOXk0YSpamHsAD2ppLxvFjF3b 408yqRYeNjy0CovtGC4OXuY5JVpFlzRBhDaJ0W/h5KisGfzFuyl8q2lT2oCY+TVyShMX 5ZSl3gv2aHdbLT8nBh/IE5QqIoSzfWhEdCxRt5jw+ixjXCDlZfpDpnG/1wL0IF9Xs01v 88yDRbLcaz1LoHBQP8qC5KRcV26um1KP7mw2ZhpRlmh+8lbqxYmhrB5eaRN4IFmbZ819 Zi6w== X-Gm-Message-State: AFqh2kqG+cJlKoP3ntt6bvTshYJ2XtTK1ngtKVOTb+C0DdmLhrU1lXXu Pek/tpXhoX1T2O/tBnNzqxk= X-Google-Smtp-Source: AMrXdXupR1Xtz9UQtUUFK3JMkEWfWiXFo3csd5N6cGZ4+i3uCZDDK3RklDVybPm6fZa8n1VHRnCWNw== X-Received: by 2002:a05:6a20:d398:b0:ac:1265:d5bb with SMTP id iq24-20020a056a20d39800b000ac1265d5bbmr6150666pzb.49.1671685246062; Wed, 21 Dec 2022 21:00:46 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id o6-20020a635a06000000b004774b5dc24dsm10426501pgb.12.2022.12.21.21.00.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2022 21:00:45 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Message-Id: <7507B4C4-A9E7-4ABF-8D34-9D176F4E20A0@gmail.com> Date: Wed, 21 Dec 2022 21:00:43 -0800 X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Theodor Thornhill writes: > On 21 December 2022 07:50:04 CET, Yuan Fu wrote: >> >>Yuan Fu writes: >> >>> Theodor Thornhill writes: >>> >>>> Hi, Yuan! >>>> >>>> It seems 'prog-fill-reindent-defun' is broken after the latest = changes >>>> to treesit-beginning-of-defun. The culprit is that we now use = remap >>>> instead of setting the beginning-of-defun-function. What is the >>>> reasoning behind that change? Can't we just rely on the variable >>>> beginning-of-defun-function? >>> >>> Not really, end-of-defun uses beginning/end-of-defun-function in a = way >>> that=E2=80=99s incompatible with nested defuns[1]. So if we want to = support >>> navigation nested defuns reliably we need to remap the commands = instead. >>> In the future (ie emacs 30), we can extend the current >>> beginning/end-of-defun to support nested defuns, then we don=E2=80=99t= need to >>> remap the commands anymore. >> >>I see the problem now... Many other functions uses >>beginning/end-of-defun. I didn=E2=80=99t thought about that initially = :-( >> >>But I don=E2=80=99t want to make big changes to beg/end-of-deun, hmmm. >> >>Yuan > > > I think you can set the functions and remap, right? Maybe you can > force the beginning-of-defun-function variant to choose the smallest > scope as a default? Or just follow the same tactic the user set? Maybe, we can have beg-of-defun-function respect treesit-defun-tactic, and end-of-defun-function simply jump to the end of the defun at point, and remap the commands as we do now. I=E2=80=99ll experiment with that = and see if it works well. Yuan From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2022 07:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.167169531414766 (code B ref 60197); Thu, 22 Dec 2022 07:49:01 +0000 Received: (at 60197) by debbugs.gnu.org; 22 Dec 2022 07:48:34 +0000 Received: from localhost ([127.0.0.1]:56763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8GJe-0003q6-56 for submit@debbugs.gnu.org; Thu, 22 Dec 2022 02:48:34 -0500 Received: from out-123.mta0.migadu.com ([91.218.175.123]:35682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8GJb-0003pz-ES for 60197@debbugs.gnu.org; Thu, 22 Dec 2022 02:48:32 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671695308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cSIOtnlkk7vRRoGAQ9xaBe+pew+PFrSKIysSBaMYF0Y=; b=yca3OekK6Zx4W1yaY1gijBnbRnXm2nETYk1FSB0Y1Oj3ZRJrxiXXSMO7VEyUjtvoKeKLXD RvqhnTwiSGNTdRkGn89WnbbinpTjW6avXdV7xL5johDZrPUa7rD7kBt7avyFPsGlGaYvnP nAAf0B+C1rdJbb7/hIZacowH3Wumlcio/hm5blcqsN0LZHytFJwNKTDDVa+pKX0cCALu6M gCaBzeEPeRjKGJWzivTA2XQatBAhbLr+Gs799NkSTLUcAmQXtL11jznhxiPV4cYi8Jsm6r 7P5oKLpCF4689VeufWY/KcgK9zgwcCOn+CupPqsMSkOfxaGLM53z+kP8qCU6QA== From: Theodor Thornhill In-Reply-To: <7507B4C4-A9E7-4ABF-8D34-9D176F4E20A0@gmail.com> References: <7507B4C4-A9E7-4ABF-8D34-9D176F4E20A0@gmail.com> Date: Thu, 22 Dec 2022 08:48:25 +0100 Message-ID: <87h6xnop4m.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yuan Fu writes: > Theodor Thornhill writes: > >> On 21 December 2022 07:50:04 CET, Yuan Fu wrote: >>> >>>Yuan Fu writes: >>> >>>> Theodor Thornhill writes: >>>> >>>>> Hi, Yuan! >>>>> >>>>> It seems 'prog-fill-reindent-defun' is broken after the latest changes >>>>> to treesit-beginning-of-defun. The culprit is that we now use remap >>>>> instead of setting the beginning-of-defun-function. What is the >>>>> reasoning behind that change? Can't we just rely on the variable >>>>> beginning-of-defun-function? >>>> >>>> Not really, end-of-defun uses beginning/end-of-defun-function in a way >>>> that=E2=80=99s incompatible with nested defuns[1]. So if we want to su= pport >>>> navigation nested defuns reliably we need to remap the commands instea= d. >>>> In the future (ie emacs 30), we can extend the current >>>> beginning/end-of-defun to support nested defuns, then we don=E2=80=99t= need to >>>> remap the commands anymore. >>> >>>I see the problem now... Many other functions uses >>>beginning/end-of-defun. I didn=E2=80=99t thought about that initially :-( >>> >>>But I don=E2=80=99t want to make big changes to beg/end-of-deun, hmmm. >>> >>>Yuan >> >> >> I think you can set the functions and remap, right? Maybe you can >> force the beginning-of-defun-function variant to choose the smallest >> scope as a default? Or just follow the same tactic the user set? > > Maybe, we can have beg-of-defun-function respect treesit-defun-tactic, > and end-of-defun-function simply jump to the end of the defun at point, > and remap the commands as we do now. I=E2=80=99ll experiment with that an= d see > if it works well. Sure! Do you mean some treesit-specific code inside of beginning-of-defun, or just making treesit-beginning-of-defun callable non-interactively? Theo From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl References: <87edsv7lc4.fsf@thornhill.no> In-Reply-To: <87edsv7lc4.fsf@thornhill.no> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2022 08:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Theodor Thornhill Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.167169910417525 (code B ref 60197); Thu, 22 Dec 2022 08:52:01 +0000 Received: (at 60197) by debbugs.gnu.org; 22 Dec 2022 08:51:44 +0000 Received: from localhost ([127.0.0.1]:57054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8HIl-0004YZ-I3 for submit@debbugs.gnu.org; Thu, 22 Dec 2022 03:51:44 -0500 Received: from mail-pj1-f54.google.com ([209.85.216.54]:54242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8HIj-0004YQ-Nk for 60197@debbugs.gnu.org; Thu, 22 Dec 2022 03:51:42 -0500 Received: by mail-pj1-f54.google.com with SMTP id v23so1239764pju.3 for <60197@debbugs.gnu.org>; Thu, 22 Dec 2022 00:51:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=r9t11hY3FEuM4XVEmIjRn59P5/uN/jlp+LW5O13y250=; b=WQgu7sK9gbvQx6MyJFC/Dej+7dloxr5yeUhvF5x4DuNs9M3515CNEuNL5HU+cwo/fD BWebvrwHVyhTN3z6W1NM17nS7NTmZ8FI89ORPSuYozMhYR/dUgj/RAeKxBK3ZtSp1ojR fYqaZLKWG9j2Y+Elc2eW2INLiJ4DIuf1rht1WDes68Uz+ZbhfekHMe/QMXbgDnWXIM51 uLg/LxIWbb8erOoUVAdNznKdm8FCvXj+BRD/TmGx+cZEzlVurCtjNasVjDOJgApPszsB 5cr2iwyv+ZpLtTq9E3lvvDnZwQ03eTujk8c/PrYZ9z7KuS65WEUGfRZI1+ONhVo2n0Qs lcKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r9t11hY3FEuM4XVEmIjRn59P5/uN/jlp+LW5O13y250=; b=PINGFm3vTsaaNoskWw4zCdSvVJYbq/sDdGEie1DM9U7e7w/W0dmndgX2nEZCqt1hQA KZRpdwfGLt0/DpVa0kV2MxaWkkQvAZ3ovya1qW0Kd7DEsCyWZ8uAuMZCE7+flz14b4dx 9lDcII27EkaHO7PBtlD5E5NhH7pHP3Lc0oSvjwX4cmvGeJXjcUhqwfGwzp8h7lX9Tp92 t8pd0gGIZCXua9nfB9EMGeYiO5f3xjdzVt0sQWGJsMvMT125f5RCQSAhV/U+jVwQxuOl nrBnS+O5KC7/lz3z9tnkHYlk10DQBqGeg6vMFH7iT6g5aqx6ZqDupJDpfc23PEP7fHMl TfnA== X-Gm-Message-State: AFqh2kqjZ+uKHb12SKlb1AmBhAvqVjeD3022VtsZ4Yp7d72ooKB+AWcw t1USnY7PSoFymi+gA8LzTcPqv0XO5BE= X-Google-Smtp-Source: AMrXdXv8WTX+XePug0T71bYu9Y/5mm0z8ZHXagl9LbDuBvnXZlytR7obWTipipwrLNfbxOqOWZc+yA== X-Received: by 2002:a17:903:32c6:b0:189:df3c:1ba1 with SMTP id i6-20020a17090332c600b00189df3c1ba1mr5943998plr.38.1671699095856; Thu, 22 Dec 2022 00:51:35 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id l9-20020a170902d34900b00187197c4999sm12850404plk.167.2022.12.22.00.51.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2022 00:51:35 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Message-Id: Date: Thu, 22 Dec 2022 00:51:33 -0800 X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Theodor Thornhill writes: > Yuan Fu writes: > >> Theodor Thornhill writes: >> >>> On 21 December 2022 07:50:04 CET, Yuan Fu wrote: >>>> >>>>Yuan Fu writes: >>>> >>>>> Theodor Thornhill writes: >>>>> >>>>>> Hi, Yuan! >>>>>> >>>>>> It seems 'prog-fill-reindent-defun' is broken after the latest = changes >>>>>> to treesit-beginning-of-defun. The culprit is that we now use = remap >>>>>> instead of setting the beginning-of-defun-function. What is the >>>>>> reasoning behind that change? Can't we just rely on the variable >>>>>> beginning-of-defun-function? >>>>> >>>>> Not really, end-of-defun uses beginning/end-of-defun-function in a = way >>>>> that=E2=80=99s incompatible with nested defuns[1]. So if we want = to support >>>>> navigation nested defuns reliably we need to remap the commands = instead. >>>>> In the future (ie emacs 30), we can extend the current >>>>> beginning/end-of-defun to support nested defuns, then we don=E2=80=99= t need to >>>>> remap the commands anymore. >>>> >>>>I see the problem now... Many other functions uses >>>>beginning/end-of-defun. I didn=E2=80=99t thought about that = initially :-( >>>> >>>>But I don=E2=80=99t want to make big changes to beg/end-of-deun, = hmmm. >>>> >>>>Yuan >>> >>> >>> I think you can set the functions and remap, right? Maybe you can >>> force the beginning-of-defun-function variant to choose the smallest >>> scope as a default? Or just follow the same tactic the user set? >> >> Maybe, we can have beg-of-defun-function respect = treesit-defun-tactic, >> and end-of-defun-function simply jump to the end of the defun at = point, >> and remap the commands as we do now. I=E2=80=99ll experiment with = that and see >> if it works well. > > Sure! Do you mean some treesit-specific code inside of > beginning-of-defun, or just making treesit-beginning-of-defun callable > non-interactively? I played around, and it seems the best we can do is to simply setting the b/e-of-defun-function. That=E2=80=99s also what cc-mode does. If = cc-mode does that for 20 years and no one complained, I think we are pretty safe. Though we should still improve end-of-defun in Emacs 30. So I did that :-) Yuan From unknown Wed Jun 18 23:10:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Dec 2022 09:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60197 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Yuan Fu Cc: 60197@debbugs.gnu.org Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.167170134619150 (code B ref 60197); Thu, 22 Dec 2022 09:30:03 +0000 Received: (at 60197) by debbugs.gnu.org; 22 Dec 2022 09:29:06 +0000 Received: from localhost ([127.0.0.1]:57250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8Hsw-0004yo-Aw for submit@debbugs.gnu.org; Thu, 22 Dec 2022 04:29:06 -0500 Received: from out-227.mta0.migadu.com ([91.218.175.227]:64162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8Hss-0004yU-Hm for 60197@debbugs.gnu.org; Thu, 22 Dec 2022 04:29:04 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671701341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=16BTEwbu/MZeN0YfxT5xeysVvKLq7CShedMtP6Y5asI=; b=eBBki2ZfAEZU/mvpSgKgqnU2jV1Pttrl1o11Lf3DI4D/3zN45VXM7t+ZjWUSJVo/06VY0Q wfj/FljjAGhXqlO6Nt/C+4F4URd1qf/f1JRdBnPoPIJDL2wjEfimKUZ2Be7/Halc+MDqm9 LeblDlq/WTvyQ2yAy33XLL2E3WDVYpNApZ0XxFnXLhMNRPS4AEAkAw51LQkbia7zxLBLPI 6xQwL7d9aBUNcFAWWPQMFwBo/Quqhzj6bmIpp+hoWuQjVIB5AWz821MWjRGkwHn0XzCOyc y49+3QYKr0nuDULP/U7PfCMiBEKYrRRoaMy6Worxkfgn8/+mLRDYrKndm7BkDQ== From: Theodor Thornhill In-Reply-To: References: Date: Thu, 22 Dec 2022 10:28:59 +0100 Message-ID: <87bknvokh0.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yuan Fu writes: > Theodor Thornhill writes: > > I played around, and it seems the best we can do is to simply setting > the b/e-of-defun-function. Yep! > That=E2=80=99s also what cc-mode does. If cc-mode does that for 20 years = and > no one complained, I think we are pretty safe. Though we should still > improve end-of-defun in Emacs 30. > Great news! Thanks! Theo From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 18:20:25 2023 Received: (at control) by debbugs.gnu.org; 7 Jan 2023 23:20:25 +0000 Received: from localhost ([127.0.0.1]:59284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEIUD-0001aS-LE for submit@debbugs.gnu.org; Sat, 07 Jan 2023 18:20:25 -0500 Received: from mail-pl1-f176.google.com ([209.85.214.176]:43524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEIUC-0001aE-FS for control@debbugs.gnu.org; Sat, 07 Jan 2023 18:20:24 -0500 Received: by mail-pl1-f176.google.com with SMTP id d3so5578010plr.10 for ; Sat, 07 Jan 2023 15:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=TEcnONYYQD3hzz6cY4GgMzi4NebJlP1xu+vMfCFfoJQ=; b=C9OQgIK5KcqyjxiA3B0PNRKTJQKZlsBgaSGGxL+JxMgQ/g3O0OUuGFzX04BzQ5U01s oqA1vHtUDB/Yhlbz7GvyRY5D4L7n7uilkqjPPAkC3NhdqVsyp7vfqJeFkvCVOWT3Jrgo yOvEm4Q7BzIykcyFPYnAFFHfdkW6i3pIQ8yaQH4dmPzJTGZPNq9dW1sedkerhNeAAOtv X8wJGZeOIzzG90vuUs30UBYunl77jmeeDVqCOoh6I6u7P3wiRR2EBrcZZTRwwNgCDtNd +pa2F5VcjeeTeToFRPIvtym4YLMDYkkEBemBmtogOkZJ88QSR2k/95AVr4xaUYFI1F2P MJJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TEcnONYYQD3hzz6cY4GgMzi4NebJlP1xu+vMfCFfoJQ=; b=okJD+DZE3gGSNUif2BwCzSANZnJLXjJRb343dxXF/aA0ClJgP1VHQEXlLBw5Bakd2I KjvvyYJCuiGJw0di03kOtQd8FqvIUjW4+zifvsCQHkztG+X8MWyt4rr2jwfjedWDpC3Y Gp26Bb0qThcqLBC3kYJTvjlp93dWdVhPETG+D6pnj18BflE73HW6jFff1uvaSnpyHyJg wgLZi/CXmofwfUW4cMDpJnB0cQL9KINNyeJ/PTsLcH4QZ07Vm7d5VU/QnCoEY2K0MrEh 0f303Jb5qV8s6i7sKZisKEBI9YLALnyTBXAWbFfuCM5S7j5x7l+6LKvsuiwEtEbr6XAD oPHA== X-Gm-Message-State: AFqh2kpFZvfC0DWWx3H9fkDRhAefY7TP0h8we4LebBZq1u1X+CpvWAYX CHJck1BwTEs2Q+bLoUfpwwkv4OMeup1nTw== X-Google-Smtp-Source: AMrXdXvNdUSJ2ArRPlUxuzTAJhE7tEiJUTSWccdJ/LrpK7m3kT2NVvS4WEjD+HwgxchZFVCN/eqXyw== X-Received: by 2002:a05:6a20:438e:b0:a5:7700:2a1a with SMTP id i14-20020a056a20438e00b000a577002a1amr80760359pzl.1.1673133618511; Sat, 07 Jan 2023 15:20:18 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id z5-20020aa79905000000b00574ee8cfdabsm3398253pff.148.2023.01.07.15.20.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2023 15:20:18 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: control message for bug #60197 Message-Id: Date: Sat, 7 Jan 2023 15:20:17 -0800 To: control@debbugs.gnu.org X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 60197 29.1 quit