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: Fri, 07 Jul 2023 09:40:12 +0300 Message-ID: <835y6wgr77.fsf@gnu.org> References: <83a5wcncj8.fsf@gnu.org> <83pm57lxbo.fsf@gnu.org> 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="31275"; 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 Fri Jul 07 08:41:36 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 1qHf9r-0007xp-SG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jul 2023 08:41:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHf9Y-0004mz-Qr; Fri, 07 Jul 2023 02:41:16 -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 1qHf9L-0004ky-6O for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 02:41:03 -0400 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 1qHf9J-0006cI-Nb for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 02:41:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qHf9J-00083B-JE for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 02:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Jul 2023 06:41:01 +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.168871202130879 (code B ref 64442); Fri, 07 Jul 2023 06:41:01 +0000 Original-Received: (at 64442) by debbugs.gnu.org; 7 Jul 2023 06:40:21 +0000 Original-Received: from localhost ([127.0.0.1]:42450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHf8e-00081w-G4 for submit@debbugs.gnu.org; Fri, 07 Jul 2023 02:40:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:38130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHf8a-00081h-3K for 64442@debbugs.gnu.org; Fri, 07 Jul 2023 02:40:19 -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 1qHf8U-0006RR-Qq; Fri, 07 Jul 2023 02:40:10 -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=S0xM3Xy4oaBbPg8HZNfX8I7RovB1GaMYmi0HLSwHosc=; b=DEjSuPfensxr5ssP0RTY TZd+VCENGjpwFGM/sVS2xdy6PepfqicaatZ7EHc63bx38gvjuE97kF0K7Q3eNcVTq4UaQSk6i6tjf LNcsT0CaejEgg2PJQ1aPlIGD1fo4b4vnxtuuHDEIFF4k59Zn4w4ATu2HFU+HQDHNudrpeDA0XPz7u o7weJbj+EGhNhVSDyMvSTHiATuLANpbzk6lpWgw42XgCjVD5sja4xcHzy92TB5v958iicKDETyZkL btj7eQbc0LmyZ9luPYEeOr8dY/qJhGpws2PnB81XUn5LwCojDPVg0LeJsqFHzXuxoFaHqPOH8Ml7g Wn1l1vg+9yyBCg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHf8T-0005zP-Sc; Fri, 07 Jul 2023 02:40:10 -0400 In-Reply-To: (message from Yuan Fu on Thu, 6 Jul 2023 23:15:00 -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:264707 Archived-At: > From: Yuan Fu > Date: Thu, 6 Jul 2023 23:15:00 -0700 > Cc: 64442@debbugs.gnu.org > > > On Jul 4, 2023, at 4:39 AM, Eli Zaretskii wrote: > > > > Why cannot we look for a top-level expression_statement node which is > > a call_expression whose function identifier is "DEFUN" and whose > > position is between the place where C-M-a was invoked and the place > > where it does find a defun? > > It’s gonna be ugly, but I can take a jab at it this weekend. I’m thinking of a wrapper function that tries to detect DEFUN before falling back to the ordinary tree-sitter defun movement function. Thanks. let's see how ugly it is before deciding whether it's worth it. > > DEFUN's cannot be nested, so we don't need to consider that. > > Yeah, in general C sources don’t have nested defuns, only C++ ones do. No, I meant the use of DEFUN macros in Emacs cannot be nested.