From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: emacs-29 02e046566e 3/3: Set beginning/end-of-defun-function in treesit-major-mode-setup Date: Thu, 22 Dec 2022 16:21:24 +0100 Message-ID: <874jtnea6j.fsf@thornhill.no> References: <167169878178.1257.12592279240667535659@vcs2.savannah.gnu.org> <20221222084623.4FFA8C0061B@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28737"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 22 16:22:44 2022 Return-path: Envelope-to: ged-emacs-devel@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 1p8NP8-0007Ag-Ke for ged-emacs-devel@m.gmane-mx.org; Thu, 22 Dec 2022 16:22:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8NOE-0005BR-TH; Thu, 22 Dec 2022 10:21:46 -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 1p8NO3-0005AN-Hn for emacs-devel@gnu.org; Thu, 22 Dec 2022 10:21:35 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8NO1-0008CL-6X for emacs-devel@gnu.org; Thu, 22 Dec 2022 10:21:35 -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=1671722486; 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=JSrPqUgmzH3982+NrnNidjS1HHjkOIWHAufmSeqlohs=; b=ssCFexrOtqWBkIjuZ4ZGdRpT4XbEcmSMuAL7ATzBlbbbQvcQj7GJP+HaFmX91eojjx7aV5 d0BZ6TD0wVsdyyYte5oSlaLY2BOmxKCTLHeLd1KBKp7loa+qeu3tokj8kUzbh+czobd5LE 4weM1wK/Ghomn35RYWsR354SfDE67Q5/zHFel8JHNaCKGNL7f9R1f3xnQ6Vbx6STcA4tnr G0rbqsfZ4/Te1uvPeKrLIDRDP6Ms4rBgIUZcnlaxALhRC1IU1sNHEd4xIE0nDymjvJaeDD zUQIiYVwr9wrbfmWrbHCm+ct3+estzbigp6UCQprzfK5Il/RpwO+jVFOHPfL3Q== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.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_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301791 Archived-At: Stefan Monnier writes: >> + ;; `end-of-defun' will not work completely correctly in nested >> + ;; defuns due to its implementation. However, many lisp programs >> + ;; use `beginning/end-of-defun', so we should still set >> + ;; `beginning/end-of-defun-function' so they still mostly work. >> + ;; This is also what `cc-mode' does: rebind user commands and set >> + ;; the variables. In future we should update `end-of-defun' to >> + ;; work with nested defuns. >> + (setq-local beginning-of-defun-function #'treesit-beginning-of-defun) >> + (setq-local end-of-defun-function #'treesit-end-of-defun))) > > Is there a bug report for that? > > > Stefan bug#60197 Theo