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#61208: 29.0.60; treesit-beginning/end-of-defun problem with macros in c-ts-mode Date: Thu, 02 Feb 2023 20:22:31 +0200 Message-ID: <83h6w4vsew.fsf@gnu.org> References: <834js51rf8.fsf@gnu.org> <963AC74E-57EA-4478-AD4C-8210DBA7EC9C@gmail.com> <83wn50y0nw.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="3274"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yingchao.yang@seaboxdata.com, theo@thornhill.no, 61208@debbugs.gnu.org, yang.yingchao@qq.com To: casouri@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 02 19:23:20 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 1pNeEy-0000hw-Eo for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Feb 2023 19:23:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNeEn-0006j9-Ph; Thu, 02 Feb 2023 13:23:09 -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 1pNeEg-0006hJ-T4 for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 13:23:08 -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 1pNeEg-0005CD-Kg for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 13:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNeEg-0004j7-8J for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 13:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Feb 2023 18:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61208 X-GNU-PR-Package: emacs Original-Received: via spool by 61208-submit@debbugs.gnu.org id=B61208.167536216118111 (code B ref 61208); Thu, 02 Feb 2023 18:23:02 +0000 Original-Received: (at 61208) by debbugs.gnu.org; 2 Feb 2023 18:22:41 +0000 Original-Received: from localhost ([127.0.0.1]:35791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNeEK-0004i3-St for submit@debbugs.gnu.org; Thu, 02 Feb 2023 13:22:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNeEI-0004hl-8z for 61208@debbugs.gnu.org; Thu, 02 Feb 2023 13:22:39 -0500 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 1pNeEA-00057D-SH; Thu, 02 Feb 2023 13:22:30 -0500 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=TbpUY1l1QJ+7A75SRmhiVZlQtqCB/UIIEtb7Ngf8zX4=; b=ikOpKIdUzLJ/12EnjI6o KMb7BmWvQn4HKAojHtvXhgC8r3fessa3MXPL0RHUTAfXSD3Ne0O4tMl8ddFsXhR2wnzWS/QafQFBy aXn8UPNxK6T2cKIni7ZzpmmJyU1qR3RhMxwbdB4GWTYJeDmL3IyuVKvC1GL6x7E5yJtBIlr+Lxub+ 7siq4B2NSGJJ18HjUpui8TvFHvHevzVEdojr75VqvH6YHHKdYbCWcfvqqY/j8aGSaokDOeaFRlmT2 tvNW0TPKugttLbcYdzf+Dh9m+f0a7DEQ+oc0rNstmKlZlJx3/geqD6j4HNAJkS+T4Aji/rVCDoLgS KfFFo8Zl2qjHSw==; 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 1pNeEA-0006kF-Bd; Thu, 02 Feb 2023 13:22:30 -0500 In-Reply-To: <83wn50y0nw.fsf@gnu.org> (message from Eli Zaretskii on Thu, 02 Feb 2023 09:41:23 +0200) 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:254686 Archived-At: > Cc: yingchao.yang@seaboxdata.com, 61208@debbugs.gnu.org, theo@thornhill.no, > yang.yingchao@qq.com > Date: Thu, 02 Feb 2023 09:41:23 +0200 > From: Eli Zaretskii > > > Treesit-defun-tactic being ’nested isn’t the problem here, at least not the direct cause of the problem. c-ts-mode doesn’t consider switch cases or if-else statements as defuns. It only considers function, struct, enum, union, as defun. So in a preprocessed C source file, C-M-a will move point to the beginning of the function, line E. It does not in this particular file because tree-sitter is thrown off by the SWITCH() and CASE() macro: it can’t tell what they are and parses them as function definitions. > > > > I don’t object setting treesit-defun-tactic to ’top-level in c-ts-mode, though. It can hide problems like this. Just be aware that it merely hides the problem. > > OK, I think I will make that change soon. Done.