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: Tue, 04 Jul 2023 14:39:55 +0300 Message-ID: <83pm57lxbo.fsf@gnu.org> References: <83a5wcncj8.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="19854"; 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 Tue Jul 04 13:40:29 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 1qGeOS-0004y8-Hl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Jul 2023 13:40:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGeOA-000225-BH; Tue, 04 Jul 2023 07:40:10 -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 1qGeO3-000212-RM for bug-gnu-emacs@gnu.org; Tue, 04 Jul 2023 07:40:04 -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 1qGeO2-0005bV-RH for bug-gnu-emacs@gnu.org; Tue, 04 Jul 2023 07:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qGeO2-0000rD-Ap for bug-gnu-emacs@gnu.org; Tue, 04 Jul 2023 07:40: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: Tue, 04 Jul 2023 11:40: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.16884707693246 (code B ref 64442); Tue, 04 Jul 2023 11:40:02 +0000 Original-Received: (at 64442) by debbugs.gnu.org; 4 Jul 2023 11:39:29 +0000 Original-Received: from localhost ([127.0.0.1]:35106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGeNU-0000qH-Po for submit@debbugs.gnu.org; Tue, 04 Jul 2023 07:39:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGeNQ-0000q2-1O for 64442@debbugs.gnu.org; Tue, 04 Jul 2023 07:39:28 -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 1qGeNK-0005UL-KO; Tue, 04 Jul 2023 07:39:18 -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=1BqtfIKUcdhfaS8bbLIMbLSo9F53Etq2rdLCdGrSCAE=; b=gKwj4oyfqvOHVGHK5+Xi 0rTZJVCBAWwUtecbWn8vRrMZmRejNDKqZ5nQ9LJhtMqflHysY4YYZLjMUgGO8qYsxF8mobfQCwSpa f5s8nKFnM+eCb0mZhtPAS0mV8cRp4eQ8dtsz2LMuryk7iYM4o2BQ5y+pdtE84F9ZXlQJSunaAcy+n P1NUgQF3unpDXEX3LL7WKM31x8D/HI5u+Ih0T3m3gm0EuPfLRbZ1yRhpfj59OYz0yrqSTC9IL8xX3 BA+QrKPB/Y6aZZ677bq94iokGvofso5MdQW79pv6MPjEKmtRa9anE4bJd0h1ZXXU7f0WkqU5G4zZC FrFy2RyQf4HC2A==; 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 1qGeNJ-0001wO-NF; Tue, 04 Jul 2023 07:39:18 -0400 In-Reply-To: (message from Yuan Fu on Tue, 4 Jul 2023 01:41:22 -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:264576 Archived-At: > From: Yuan Fu > Date: Tue, 4 Jul 2023 01:41:22 -0700 > Cc: 64442@debbugs.gnu.org > > The problem with DEFUN’s is that a DEFUN is really made of two nodes in the parse tree. One for the DEFUN part, one for the body, and there isn’t a parent node that encloses the two. > > The defun movement functions are not designed to handle a construct made of two adjacent nodes. They can find a node, go to the beginning/end of it; they can’t find a node, and go to the end of the next node. > > It sounds easy to add some hack to handle it, but really isn’t. Defun movement need to support forward/backward to beg/end, that’s four movement types; 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? > on top of that you have nested defun’s. DEFUN's cannot be nested, so we don't need to consider that. Thanks.