From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64442: 29.0.92; treesit-beginning-of-defun fails in DEFUN functions in C Date: Sat, 12 Aug 2023 17:59:37 +0300 Message-ID: <83a5uwe27a.fsf@gnu.org> References: <83a5wcncj8.fsf@gnu.org> <83pm57lxbo.fsf@gnu.org> <835y6wgr77.fsf@gnu.org> <93E5B9EA-D349-4316-B314-D6994329C261@gmail.com> <83r0oplvro.fsf@gnu.org> <83y1iji7b7.fsf@gnu.org> <2134730B-05A4-4032-84B6-42FD3CDC48AE@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6048"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64442@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 12 17:00:24 2023 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 1qUq6J-0001PA-Vi for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Aug 2023 17:00:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUq66-0003uf-2v; Sat, 12 Aug 2023 11:00:11 -0400 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 1qUq5y-0003uE-QP for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 11:00:02 -0400 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 1qUq5y-0004ls-Gq for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 11:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUq5y-0002LJ-8r for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 11:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Aug 2023 15:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64442 X-GNU-PR-Package: emacs Original-Received: via spool by 64442-submit@debbugs.gnu.org id=B64442.16918523558918 (code B ref 64442); Sat, 12 Aug 2023 15:00:02 +0000 Original-Received: (at 64442) by debbugs.gnu.org; 12 Aug 2023 14:59:15 +0000 Original-Received: from localhost ([127.0.0.1]:51002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUq5D-0002Jl-8Z for submit@debbugs.gnu.org; Sat, 12 Aug 2023 10:59:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUq59-0002JU-8z for 64442@debbugs.gnu.org; Sat, 12 Aug 2023 10:59:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUq53-0004gi-SU; Sat, 12 Aug 2023 10:59:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=2t9fw40Rr+nVYKUmiVLX6x10d77yO+XA065rlB3AryY=; b=FWU8QNAl14IokLWcj1lm 7vq8sAcC7KpRxHLeRoOWAm8bPptVTWBvoIxPxJd/FW1M6TpcLx58vm7cOqD0yAh6UM3azzXVqgEyN BOmIm8ujkWDV8Efdd3UdzBanm1oCXKgaZb3XvFTtUdmYCPpc422SSulkX/WkHqFhfA5mcqIqc2z0Q JzuZehukNLz1KU5m+K2DQAiQ8jNKxWA4N1J1AJ5PZK3acKA1Y61lcNsVEADLMHaNsFfej7sN2/BZR mgQAEOvwhsN0wa014QxI5e8TXzjE4l5bpWFz/mjxixtC7iGkkOPwCMTVy/7tCpzgbsmMSR6quOZk2 Psv9/hyt+qm0Cg==; In-Reply-To: <2134730B-05A4-4032-84B6-42FD3CDC48AE@gmail.com> (message from Yuan Fu on Thu, 10 Aug 2023 14:33:09 -0700) 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:267310 Archived-At: > From: Yuan Fu > Date: Thu, 10 Aug 2023 14:33:09 -0700 > Cc: 64442@debbugs.gnu.org > > I still don’t have a good solution. But I just realized that we might be able to make a little compromise: what if Emacs recognizes DEFUN, but as two separate parts (the declaration and the body), rather than one? It’s hard to make it recognize DEFUN as a single defun, but making it recognize DEFUN as two parts is easy. > > Try this patch and see if you like the behavior. Personally I find it quite alright. I like this much better than what we have now, thanks. But I have a question: can we perhaps recognize the "function" of the body as such, and then automatically move to the previous defun, which is the right place? The "defun" that is the body has no name, so maybe that could be used as a sign? That would allow "C-x 4 a" to work inside a DEFUN, something that still works less reliably with this patch: you must be in the "first defun" to get it to find the name of the function. But if improving this is hard, I'll settle for what you have now, thanks a lot.