GNU bug report logs - #61209
29.0.60; treesit-beginning/end-of-defun problem with macros in c-ts-mode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: yang.yingchao@HIDDEN; merged with #61208; dated Wed, 1 Feb 2023 09:14:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 61208 61209. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Feb 2023 09:13:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 01 04:13:23 2023
Received: from localhost ([127.0.0.1]:56447 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pN9B6-0005Z0-1k
	for submit <at> debbugs.gnu.org; Wed, 01 Feb 2023 04:13:23 -0500
Received: from lists.gnu.org ([209.51.188.17]:39056)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yang.yingchao@HIDDEN>) id 1pN6im-0006a0-Q1
 for submit <at> debbugs.gnu.org; Wed, 01 Feb 2023 01:35:53 -0500
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 <yang.yingchao@HIDDEN>)
 id 1pN6il-00072L-I3
 for bug-gnu-emacs@HIDDEN; Wed, 01 Feb 2023 01:35:51 -0500
Received: from out162-62-57-252.mail.qq.com ([162.62.57.252])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yang.yingchao@HIDDEN>)
 id 1pN6ij-0007aj-3J
 for bug-gnu-emacs@HIDDEN; Wed, 01 Feb 2023 01:35:51 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512;
 t=1675233339; bh=lcBJelZK+QxaIT+g4aE6CZiwtu/QZTmQ3uqUqOkmbdM=;
 h=From:To:Cc:Subject:Date:Reply-To;
 b=EQ+5FjAypnQNzRPN0P6cKJWeOpenMAbSeR+HkAuTDyt5PZx+/Ll0KPwjKCZNZJat0
 tqweSMMxuh8Ya3eUKu9kteMVoszqDnY8elwwrSGiRdWKU8/65VH8m2hUPRLqkz1r8g
 7SYp5zNU1PV+A9cv+yvKAWvB9LsqCjG06RDIrdu4=
Received: from tbook ([60.26.148.134])
 by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP
 id 71712CB4; Wed, 01 Feb 2023 14:28:23 +0800
X-QQ-mid: xmsmtpt1675232903tzhwi26wg
Message-ID: <tencent_54DB7385559F2352C64727FC8464E3020B08@HIDDEN>
X-QQ-XMAILINFO: Nci1v0XuD9lF0nABkaXnK4kVKBwS0wuOCxbwAAW/89WWef8Ha5+NoBwZjEXf10
 NQttV8GPNDLP1qP67XWCzTwSkNCWkM1bVyitSFPXgOFudgC8cHQ7AgQfUdfAsG2jDlUtTAqw9nqM
 MXBgn4MkmLDDbmmcOGYTlHfyLb5yxt4I3RIjiUDYMIVqYNwjkg4IgDorhjbMlVI8uNzoIYgmeURD
 feXHQFC8GrvrlOWvZcPoqTKwjt0p1om9gnn0bbI1FYA6JglOiS56CfibTDphn/HSAgYfMp/DZ5rT
 cnsPA7LO87/5IqVQg+aRVxB4fU31HlVuUkSv/1c4GoSikvkD5M0OEduM442/gb/uM2qgEs5wj15x
 2l3RLv+pL4MXb5GjpiH8tZgsXftLf8OQWLnhMtZA+8MKzJ5IZKe4gsV5NWz/15KfTrcrPcVNTe36
 wzYCEWb9FNke9s95cKzkAP7gAg8yJ0OckqnY5OJov4qSf7ASTnO8MN+a/n96XXjPYHx1048rFX8r
 Wu9dIMvm10iENPmC1HhdF+U6hyZNPLMfTBqlZ10twlSJecx07ARTg77+CMsbGE7XQCh01/HTozj4
 LrpyruJXjT+gvxjiJ7TRMSwBu2Ess72i1Q0xdzBCN/N0u+pkIabe3COWM/Ou4AVYSi59DZPmeS76
 EfN8WNcFOGDFOQFK3vK939KUaRALXM5DHeAZZ9uJ58ZubzDiHbWe19lEB2C1WeMtsgnzCcCb9UU/
 ROoUbRLbac4KGJIs9zcxkhf7rsxkQIvFzzqPihQ2MMIChIkMkothgc5UOwuE9MJVozT6FC1ld0dw
 pRDk6t06xlheok3Xdkm+P0SSc1hOW50APt9eJ48Wac5kITeUD0KL708ZerUGtkAd00GQMGEaIY58
 3IynmDs6KhvjXt3UaBi/5bx2qmT74dQe10pQ79lqYXB2d2dDxPZq51aop/AeW0+2Cf3mbHcn6Vm9
 XvDWV6OrwmiUtsKl8+cQFUfT1Q39jEqBaumgJfxOj91ZmHQfQObpKwiP/U4Xfa2eR3/7HucvQQpf
 fiWgsS1A==
From: Yang Yingchao <yang.yingchao@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.60; treesit-beginning/end-of-defun problem with macros in
 c-ts-mode
Date: Wed, 01 Feb 2023 14:27:35 +0800
User-agent: mu4e 1.8.13; emacs 29.0.60
Message-ID: <87tu0599x2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=162.62.57.252; envelope-from=yang.yingchao@HIDDEN;
 helo=out162-62-57-252.mail.qq.com
X-Spam_score_int: 8
X-Spam_score: 0.8
X-Spam_bar: /
X-Spam_report: (0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HELO_DYNAMIC_IPADDR=1.951, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H2=-0.001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 01 Feb 2023 04:13:09 -0500
Cc: yang.yingchao@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: yang.yingchao@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: multipart/alternative; boundary="==-=-="

--==-=-=
Content-Type: text/plain
Content-Disposition: inline

Hi **,

From: Yang Yingchao <yang.yingchao@HIDDEN>
Reply-To: yang.yingchao@HIDDEN
Date: Wed, 01 Feb 2023 14:19:30 +0800
Cc: yang.yingchao@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.60;  treesit-beginning/end-of-defun problem with macros in c-ts-mode
--text follows this line--

treesit-beginning/end-of-defun in c-ts-mode not work correctly with macros.

For example, in the following codes:

#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...


Regards...




In GNU Emacs 29.0.60 (build 15, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2023-02-01 built on tbook
Repository revision: c345ec43995051e3fb412cfb8f24d0e931b7de5e
Repository branch: yc-hacking
System Description: Gentoo Linux

Configured using:
 'configure 'CFLAGS=-O2 -march=native -pipe -g' LDFLAGS=
 --with-native-compilation --without-pop --without-imagemagick
 --with-xml2 --with-json --with-modules --with-pgtk'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: zh_CN.UTF8
  value of $XMODIFIERS: @im=fcitx
  locale-coding-system: utf-8-unix

Major mode: C

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils c-ts-mode
c-ts-common treesit pp cl-print byte-opt thingatpt help-fns radix-tree
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs cl-loaddefs comp comp-cstr warnings icons subr-x rx
cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib
china-util rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 116552 13400)
 (symbols 48 9439 0)
 (strings 32 29132 1837)
 (string-bytes 1 934955)
 (vectors 16 19030)
 (vector-slots 8 379928 16623)
 (floats 8 36 34)
 (intervals 56 432 0)
 (buffers 984 14))


-- 
Yang Yingchao
Yang Yingchao

--==-=-=
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<html xmlns=3D"http://www.w3.org/1999/xhtml" lang=3D"en" xml:lang=3D"en"><h=
ead><meta http-equiv=3D"Content-Type" content=3D"text/html;charset=3Dutf-8"=
/><meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=3D=
1"/><meta name=3D"generator" content=3D"Org Mode"/></head><body style=3D"ma=
rgin-top:0;color:black;line-height:18pt;font-size:12pt;">
<div id=3D"content" class=3D"content">
<p>
Hi **,
</p>

<p>
From: Yang Yingchao &lt;yang.yingchao@HIDDEN&gt;
Reply-To: yang.yingchao@HIDDEN
Date: Wed, 01 Feb 2023 14:19:30 +0800
Cc: yang.yingchao@HIDDEN
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.60;  treesit-beginning/end-of-defun problem with macros in c-=
ts-mode
=E2=80=93text follows this line=E2=80=93
</p>

<p>
treesit-beginning/end-of-defun in c-ts-mode not work correctly with macros.
</p>

<p>
For example, in the following codes:
</p>

<p>
#define SWITCH()
#define CASE(name)		case name:
</p>

<p>
void func(int i)        <i>/ LINE_E
{
    SWITCH(i)           /</i> LINE_D
    {
        CASE(A)         <i>/ LINE_C
        {
            ;
        }
        CASE(B)         /</i> LINE_B
        {
            ;           // LINE_A
        }
    }
}
</p>

<p>
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=E2=80=A6
</p>


<p>
Regards=E2=80=A6
</p>




<p>
In GNU Emacs 29.0.60 (build 15, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2023-02-01 built on tbook
Repository revision: c345ec43995051e3fb412cfb8f24d0e931b7de5e
Repository branch: yc-hacking
System Description: Gentoo Linux
</p>

<p>
Configured using:
 'configure 'CFLAGS=3D-O2 -march=3Dnative -pipe -g' LDFLAGS=3D
 =E2=80=93with-native-compilation =E2=80=93without-pop =E2=80=93without-ima=
gemagick
 =E2=80=93with-xml2 =E2=80=93with-json =E2=80=93with-modules =E2=80=93with-=
pgtk'
</p>

<p>
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB
</p>

<p>
Important settings:
  value of $LANG: zh_CN.UTF8
  value of $XMODIFIERS: @im=3Dfcitx
  locale-coding-system: utf-8-unix
</p>

<p>
Major mode: C
</p>

<p>
Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
</p>

<p>
Load-path shadows:
None found.
</p>

<p>
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils c-ts-mode
c-ts-common treesit pp cl-print byte-opt thingatpt help-fns radix-tree
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs cl-loaddefs comp comp-cstr warnings icons subr-x rx
cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib
china-util rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win
pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process
native-compile emacs)
</p>

<p>
Memory information:
((conses 16 116552 13400)
 (symbols 48 9439 0)
 (strings 32 29132 1837)
 (string-bytes 1 934955)
 (vectors 16 19030)
 (vector-slots 8 379928 16623)
 (floats 8 36 34)
 (intervals 56 432 0)
 (buffers 984 14))
</p>


<p>
=E2=80=93=20
Yang Yingchao
Yang Yingchao
</p>
</div>
</body></html>
--==-=-=--

--=-=-=--




Acknowledgement sent to yang.yingchao@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#61209; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 10 Sep 2023 17:30:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.