From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61208: 29.0.60; treesit-beginning/end-of-defun problem with macros in c-ts-mode Date: Wed, 01 Feb 2023 14:10:48 +0100 Message-ID: <877cx11qg7.fsf@thornhill.no> References: <834js51rf8.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20584"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yang.yingchao@qq.com, 61208@debbugs.gnu.org To: Eli Zaretskii , yingchao.yang@seaboxdata.com, Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 01 14:11:35 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 1pNCtj-0005Cy-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Feb 2023 14:11:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNCtF-0001f4-FT; Wed, 01 Feb 2023 08:11:05 -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 1pNCtD-0001cY-4q for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 08:11:03 -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 1pNCtC-0001mZ-So for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 08:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNCtC-0005kE-IX for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 08:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Feb 2023 13:11: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.167525705522062 (code B ref 61208); Wed, 01 Feb 2023 13:11:02 +0000 Original-Received: (at 61208) by debbugs.gnu.org; 1 Feb 2023 13:10:55 +0000 Original-Received: from localhost ([127.0.0.1]:56825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNCt5-0005jm-9m for submit@debbugs.gnu.org; Wed, 01 Feb 2023 08:10:55 -0500 Original-Received: from out-169.mta1.migadu.com ([95.215.58.169]:44859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNCt1-0005jQ-IX for 61208@debbugs.gnu.org; Wed, 01 Feb 2023 08:10:53 -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=1675257050; 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=p4SzuwynSu5MBvWuydrqS5pQW67Za6S+VywL9KfTkEs=; b=bdwGiS5f99JqFZMb9yG4NOb4Cfx8Bs8iqckVt9VhhQK+j+3iL+RFuJC4vyBeGhxp3Aw99h 6CdrsZzGO7dbKa9y8L/aVA7VpmKe6GENVImR6LF8X6tGP3mbm2XP2rcjbOohDQRWrK1j3h 4udDmmjV7FZlWnkZe2I46Mmieau9sW0nqfn+YN58T4qm8sy7ciAP+QtFhcU82HsmrRfmNC /hpYqWDgWyHvSHz7Ak/t/mMGAKTsKS/xQ+WrrZ0l7wm9H15KEAIGMc4St+vUnGKLdx1mM6 ot/N9K63j19U3fseOZkIsjAIGmzzyR0r1KehMfOOmjOKIC9JL3Clsojhlv2HXw== In-Reply-To: <834js51rf8.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT 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:254575 Archived-At: Eli Zaretskii writes: >> Cc: yang.yingchao@qq.com >> Date: Wed, 01 Feb 2023 14:33:24 +0800 >> From: Yang Yingchao via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> >> #define SWITCH() >> #define CASE(name) case name: >> >> void func(int i) // LINE_E >> { >> SWITCH(i) // LINE_D >> { >> CASE(A) // LINE_C >> { >> ; >> } >> CASE(B) // LINE_B >> { >> ; // LINE_A >> } >> } >> } >> >> When cursor is at LINE_A, and stoke `C-M-a`, cursor will go to LINE_B; >> then `C-M-a` again, cursor goes to LINE_C, then `C-M-a` again, LINE_D, >> and `C-M-a` again, finally to LINE_E... > > Set treesit-defun-tactic to 'top-level, and your problem is solved. > > Yuan, Theo: do we want to have that set by default in ts-c-mode? C > doesn't have nested functions, so it should be a better default, what > with all the cpp madness that the C grammar doesn't grok. > > Maybe also in C++ and Java -- AFAIU they don't have nested functions > either. > > WDYT? I'm fine with that change, I think. Other, "smaller" constructs can be found as sentences or sexps anyway, I think. Theo