From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60197: 30.0.50; beginning-of-defun broken after new treesit impl Date: Thu, 22 Dec 2022 08:48:25 +0100 Message-ID: <87h6xnop4m.fsf@thornhill.no> References: <7507B4C4-A9E7-4ABF-8D34-9D176F4E20A0@gmail.com> Reply-To: Theodor Thornhill 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="33475"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60197@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 22 08:49:44 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 1p8GKk-0008Uq-JU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Dec 2022 08:49:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8GK9-0005SF-BF; Thu, 22 Dec 2022 02:49:05 -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 1p8GK6-0005QN-JA for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 02:49: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 1p8GK6-0002Ex-7c for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 02:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8GK5-0003qN-Lr for bug-gnu-emacs@gnu.org; Thu, 22 Dec 2022 02:49:01 -0500 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 60197-submit@debbugs.gnu.org id=B60197.167169531414766 (code B ref 60197); Thu, 22 Dec 2022 07:49:01 +0000 Original-Received: (at 60197) by debbugs.gnu.org; 22 Dec 2022 07:48:34 +0000 Original-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 Original-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== In-Reply-To: <7507B4C4-A9E7-4ABF-8D34-9D176F4E20A0@gmail.com> X-Migadu-Flow: FLOW_OUT 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:251645 Archived-At: 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