From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 08 12:55:47 2025 Received: (at submit) by debbugs.gnu.org; 8 Jan 2025 17:55:47 +0000 Received: from localhost ([127.0.0.1]:48894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVaHS-0000kD-03 for submit@debbugs.gnu.org; Wed, 08 Jan 2025 12:55:47 -0500 Received: from lists.gnu.org ([2001:470:142::17]:38530) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tVZrH-0006oI-82 for submit@debbugs.gnu.org; Wed, 08 Jan 2025 12:28:44 -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 ) id 1tVZr2-00027P-HX for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 12:28:29 -0500 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVZqy-0007t3-Ev for bug-gnu-emacs@gnu.org; Wed, 08 Jan 2025 12:28:26 -0500 Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-6d8f99cb0d9so863966d6.0 for ; Wed, 08 Jan 2025 09:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736357302; x=1736962102; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=BO5+/TfQGst4zO+w0Na3jWgea0q4nyyc43X0+RLeQgk=; b=OwlulF58gysXw+CrrzML5Lk2aQGFtVk9g1SAuJ79gIbOW7WuaodJmPSwwlCH0oelCa gvFhnHbQwVnfOOKmFS9R3al7Y3lX1YEBCxzvWfrw34sfX/FxUlK3riewHO1PUGIXx330 OCxmSfIpvX+oDmQAwrcALebxhbVr7Nl1WkN2YUgMFeEZ5fd06HqCYCL9/QQsDN8TicjJ IF7/2PCQnP2E8mlXq+f0QwrfJsEdgZxb3C0PJZNN8mAssKpsvrnHUHAhHE9AxySHAdA7 OwTh8oUGl/ETPl0nSjVAwUOagmHNWJIzPY5IgdDrJZJv2nORO6UI54D5recwjhCnRngk 7TPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736357302; x=1736962102; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=BO5+/TfQGst4zO+w0Na3jWgea0q4nyyc43X0+RLeQgk=; b=vB99K+9NlK0vGIAJeHYMIaa872vdRSxUqZTdaoPknX0KXS5HqTwN9wQv0RTapywB6I SVKeHLBuonbMcTs04c/9eRp3jbzwVDMW/9KU1kvZW06UDwiMMMoiIrM2XXtUJLe3w1fQ 5ssFE7YJurUvvgPbvegYxY11n4BpFuajGJxgQE7AYpQKkYzAOwO0cz97D1yo3gbPVIJ8 lUjbO76aFBiNLokbNqBqNjoQ2SceAvfd0x/0NpWpGUvMCqZHbLrPoOCeLiObQioB+gLx P/Hz2L0ALCOReBgNHqepbNXt2tKbB+142oPCPwZECpVn6UN1cbVXsyydMYj1F3YZUWY3 JzPQ== X-Gm-Message-State: AOJu0YzLGyDW1R3MCP2KSOv2/qNLvHd12cOFR1v4e9lbzmo/1lU9aXv/ fpm8rTgO5EzJApH9MQ3d6SkWDWOgX92sVaF5/IqAKCrBP9H/N21X1P+loHp5MpSyKDuqcCI5YwI iMKwXKMc2pBEKMQKctEPpH15pC2+P3TDlT4M= X-Gm-Gg: ASbGncvTtKxiNxxwySyWbUj+UpJRjbjL1iAiXFQ2tioUKChZrXDe1nQ96FvW3JOamCd 0qAW85j8zGKSPeqnPTkY0l3VJ9pgg3yq9CZi5pA== X-Google-Smtp-Source: AGHT+IHqtdozZ4calhmLNKApvq5LJ3rLz45nxjU1wMnSx3MO+U1izdF1xUdwoCxZnpdvJ/6xmF0Z4kLncS4e1CC68WU= X-Received: by 2002:a05:6214:dc4:b0:6d8:a2c1:2bf4 with SMTP id 6a1803df08f44-6df9b1f6bdfmr61552076d6.6.1736357301893; Wed, 08 Jan 2025 09:28:21 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?Q?Uygar_K=C3=96SEER?= Date: Wed, 8 Jan 2025 20:28:11 +0300 X-Gm-Features: AbW1kvZOhuRA0Y3hvua5kZcyRz8XANz2c-8xGq5fLcOESN6txkfhigDw2osu3kQ Message-ID: Subject: 31.0.50; c-ts-mode indentation problem To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="0000000000002ec0fb062b35309f" Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=uygarkoseer@gmail.com; helo=mail-qv1-xf36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 08 Jan 2025 12:55:43 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --0000000000002ec0fb062b35309f Content-Type: text/plain; charset="UTF-8" Hi, I started to use c-ts-mode (tree-sitter) and I think there is a little indentation problem when typedef declaration is used. Wrong indentation case: typedef struct Point { int x; int y; } Point; I think this happens because it aligns it with the struct keyword. Working case: typedef struct Point Point; struct Point { int x; int y; } Point; This case works without problem because the struct keyword is at the beginning of the line. Both of the cases are matched with this part in c-ts-mode.el: ((parent-is ,(rx (or "function_definition" "struct_specifier" "enum_specifier" "function_declarator" "template_declaration"))) parent 0) I also tried to change this behaviour by adding new rules to my c-ts-mode configuration but it always matches with the default configuration first. I do not know if there is any way to change this behaviour without re-defining all the default configuration. In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2025-01-08 built on DESKTOP-NF56V2Q System Description: Ubuntu 22.04.3 LTS Configured using: 'configure --with-native-compilation --with-pgtk --with-x-toolkit=lucid --with-tree-sitter --with-mailutils' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB Important settings: value of $LANG: C.UTF-8 locale-coding-system: utf-8-unix Major mode: C/* Minor modes in effect: highlight-numbers-mode: t rainbow-delimiters-mode: t fancy-dabbrev-mode: t marginalia-mode: t savehist-mode: t projectile-mode: t vertico-mode: t gcmh-mode: t recentf-mode: t repeat-mode: t global-auto-revert-mode: t global-so-long-mode: t global-hl-line-mode: t electric-pair-mode: t override-global-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t window-divider-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t global-visual-line-mode: t visual-line-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: /home/nukoseer/.emacs.d/elpa/modus-themes-20241228.1050/theme-loaddefs hides /usr/local/share/emacs/31.0.50/lisp/theme-loaddefs Features: (shadow sort mail-extr emacsbug message yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils mule-util bug-reference cursor-sensor comp-run comp-common highlight-numbers parent-mode rainbow-delimiters fancy-dabbrev popup dabbrev c++-ts-mode c-ts-mode c-ts-common treesit which-key marginalia orderless savehist projectile project lisp-mnt thingatpt rg vc vc-dispatcher rg-info-hack rg-menu transient pcase rg-ibuffer rg-result wgrep-rg wgrep rg-history rg-header ibuf-ext ibuffer ibuffer-loaddefs vertico compat tramp trampver tramp-integration files-x tramp-message tramp-compat shell pcomplete parse-time iso8601 time-date format-spec tramp-loaddefs smartscan gcmh modus-vivendi-theme modus-themes cus-edit pp grep compile text-property-search comint ansi-osc ansi-color ring cus-load recentf tree-widget wid-edit repeat autorevert filenotify display-line-numbers so-long hl-line elec-pair narrow-indirect make-mark-visible edmacro kmacro advice rx cl-extra help-mode finder-inf use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core avy-autoloads buffer-move-autoloads consult-dir-autoloads dumb-jump-autoloads dash-autoloads embark-consult-autoloads consult-autoloads embark-autoloads fancy-dabbrev-autoloads gcmh-autoloads highlight-numbers-autoloads marginalia-autoloads modus-themes-autoloads multiple-cursors-autoloads orderless-autoloads parent-mode-autoloads popup-autoloads projectile-autoloads rainbow-delimiters-autoloads info rg-autoloads s-autoloads smartscan-autoloads vertico-autoloads wgrep-autoloads package browse-url xdg url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib 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 touch-screen 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 move-toolbar make-network-process tty-child-frames native-compile emacs) Memory information: ((conses 16 485596 224491) (symbols 48 26240 173) (strings 32 135066 15749) (string-bytes 1 3787317) (vectors 16 36037) (vector-slots 8 439371 76445) (floats 8 134 924) (intervals 56 827 240) (buffers 992 13)) --0000000000002ec0fb062b35309f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I started to use c-ts-mode (tree-sitter) and I = think there is a little
indentation problem when typedef declaration is = used.

Wrong indentation case:

typedef struct Point
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int x;<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int y;
=C2=A0 =C2=A0 =C2=A0= =C2=A0 } Point;

I think this happens because it aligns it with the = struct keyword.

Working case:
typedef struct Point Point;
stru= ct Point
{
=C2=A0 =C2=A0 int x;
=C2=A0 =C2=A0 int y;
} Point;
This case works without problem because the struct keyword is at the<= br>beginning of the line.

Both of the cases are matched with this pa= rt in c-ts-mode.el:
((parent-is ,(rx (or "function_definition"=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "struct_specifier"
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "enum_specifier"
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "function_declarator"
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "template_declaration")))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 parent 0)

I also tried to cha= nge this behaviour by adding new rules to my
c-ts-mode configuration but= it always matches with the default
configuration first. I do not know i= f there is any way to change this
behaviour without re-defining all the = default configuration.


In GNU Emacs 31.0.50 (build 1, x86_64-pc-= linux-gnu, GTK+ Version
=C2=A03.24.33, cairo version 1.16.0) of 2025-01-= 08 built on DESKTOP-NF56V2Q
System Description: Ubuntu 22.04.3 LTS
Configured using:
=C2=A0'configure --with-native-compilation --wit= h-pgtk --with-x-toolkit=3Dlucid
=C2=A0--with-tree-sitter --with-mailutil= s'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP = GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LI= BXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP S= OUND THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER XIM GTK3 ZLIB

I= mportant settings:
=C2=A0 value of $LANG: C.UTF-8
=C2=A0 locale-codin= g-system: utf-8-unix

Major mode: C/*

Minor modes in effect:=C2=A0 highlight-numbers-mode: t
=C2=A0 rainbow-delimiters-mode: t
= =C2=A0 fancy-dabbrev-mode: t
=C2=A0 marginalia-mode: t
=C2=A0 savehis= t-mode: t
=C2=A0 projectile-mode: t
=C2=A0 vertico-mode: t
=C2=A0 = gcmh-mode: t
=C2=A0 recentf-mode: t
=C2=A0 repeat-mode: t
=C2=A0 g= lobal-auto-revert-mode: t
=C2=A0 global-so-long-mode: t
=C2=A0 global= -hl-line-mode: t
=C2=A0 electric-pair-mode: t
=C2=A0 override-global-= mode: t
=C2=A0 show-paren-mode: t
=C2=A0 electric-indent-mode: t
= =C2=A0 mouse-wheel-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 glo= bal-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 window-divider-= mode: t
=C2=A0 minibuffer-regexp-mode: t
=C2=A0 column-number-mode: t=
=C2=A0 line-number-mode: t
=C2=A0 global-visual-line-mode: t
=C2= =A0 visual-line-mode: t
=C2=A0 indent-tabs-mode: t
=C2=A0 transient-m= ark-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mo= de: t
=C2=A0 auto-compression-mode: t

Load-path shadows:
/home= /nukoseer/.emacs.d/elpa/modus-themes-20241228.1050/theme-loaddefs hides /us= r/local/share/emacs/31.0.50/lisp/theme-loaddefs

Features:
(shadow= sort mail-extr emacsbug message yank-media puny dired
dired-loaddefs rf= c822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util mm-decode = mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader s= endmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils mule-ut= il bug-reference cursor-sensor comp-run
comp-common highlight-numbers pa= rent-mode rainbow-delimiters
fancy-dabbrev popup dabbrev c++-ts-mode c-t= s-mode c-ts-common treesit
which-key marginalia orderless savehist proje= ctile project lisp-mnt
thingatpt rg vc vc-dispatcher rg-info-hack rg-men= u transient pcase
rg-ibuffer rg-result wgrep-rg wgrep rg-history rg-head= er ibuf-ext
ibuffer ibuffer-loaddefs vertico compat tramp trampver tramp= -integration
files-x tramp-message tramp-compat shell pcomplete parse-ti= me iso8601
time-date format-spec tramp-loaddefs smartscan gcmh modus-viv= endi-theme
modus-themes cus-edit pp grep compile text-property-search co= mint
ansi-osc ansi-color ring cus-load recentf tree-widget wid-edit repe= at
autorevert filenotify display-line-numbers so-long hl-line elec-pair<= br>narrow-indirect make-mark-visible edmacro kmacro advice rx cl-extra
h= elp-mode finder-inf use-package use-package-ensure use-package-delight
u= se-package-diminish use-package-bind-key bind-key easy-mmode
use-package= -core avy-autoloads buffer-move-autoloads
consult-dir-autoloads dumb-jum= p-autoloads dash-autoloads
embark-consult-autoloads consult-autoloads em= bark-autoloads
fancy-dabbrev-autoloads gcmh-autoloads highlight-numbers-= autoloads
marginalia-autoloads modus-themes-autoloads multiple-cursors-a= utoloads
orderless-autoloads parent-mode-autoloads popup-autoloads
pr= ojectile-autoloads rainbow-delimiters-autoloads info rg-autoloads
s-auto= loads smartscan-autoloads vertico-autoloads wgrep-autoloads
package brow= se-url xdg url url-proxy url-privacy url-expand url-methods
url-history = url-cookie generate-lisp-file url-domsuf url-util mailcap
url-handlers u= rl-parse auth-source cl-seq eieio eieio-core cl-macs icons
password-cach= e json subr-x map byte-opt gv bytecomp byte-compile
url-vars cl-loaddefs= cl-lib 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 touch-screen pgtk-dnd tool-bar
dnd fontset image regexp-= opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mo= de register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer sel= ect scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors= frame minibuffer nadvice seq simple cl-generic
indonesian philippine ch= am georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao ko= rean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech europe= an ethiopic indian cyrillic chinese
composite emoji-zwj charscript charp= rop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-pr= eloaded button loaddefs
theme-loaddefs faces cus-face macroexp files win= dow text-properties
overlay sha1 md5 base64 format env code-pages mule c= ustom widget keymap
hashtable-print-readable backquote threads dbusbind = inotify
dynamic-setting system-font-setting font-render-setting cairo gt= k pgtk
lcms2 multi-tty move-toolbar make-network-process tty-child-frame= s
native-compile emacs)

Memory information:
((conses 16 485596= 224491) (symbols 48 26240 173)
=C2=A0(strings 32 135066 15749) (string-= bytes 1 3787317) (vectors 16 36037)
=C2=A0(vector-slots 8 439371 76445) = (floats 8 134 924)
=C2=A0(intervals 56 827 240) (buffers 992 13))
--0000000000002ec0fb062b35309f-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 10 20:20:58 2025 Received: (at 75442) by debbugs.gnu.org; 11 Jan 2025 01:20:58 +0000 Received: from localhost ([127.0.0.1]:40311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tWQBO-00035k-AD for submit@debbugs.gnu.org; Fri, 10 Jan 2025 20:20:58 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:56815) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tWQBL-00035U-06 for 75442@debbugs.gnu.org; Fri, 10 Jan 2025 20:20:55 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5d3e6f6cf69so4239101a12.1 for <75442@debbugs.gnu.org>; Fri, 10 Jan 2025 17:20:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736558449; x=1737163249; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=jqhQRI+K/FDxU8Smsou7zcCFsZ2YjOB6j9C3sEt7OvU=; b=kc0D6GTJcaeSzq/+KshVfnxlSxnuooAgBpopiDgG/AlFJLw6TWq3YAaGkAKTvui1kG Vw00HRcYeDp9H+g5McAG0JstDg4vjqeUeW3uFpIDJn4Fg5RUX3Fn3/peYu8KrB9dRHwA 5LXudSZ6GnCT0H34McpgEut0AnmPhRVlOAXCNvDrtvcLQiIsIxxW07gakmBpGxPn7DuV +pD5m1XM1szzKGWSRWUUlBylGxNADecIpk9R0gdxF0DRsvZtw1KiO3TfmHzwawvzjfZP TqIBNgabLmYU4TbpnRVRqxTiRC9soSrknRfndHqMpyY3cX2shduSzMZw22qIn/BiIP/Z kaSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736558449; x=1737163249; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=jqhQRI+K/FDxU8Smsou7zcCFsZ2YjOB6j9C3sEt7OvU=; b=V1UomSavlpMHSAOrq5q9ZK78GvzMrPPyx6BKf/DAK9m6Hy6yTPwubZ9zkcjodKUFNP olMU1MEeosgcSqAxGGorrd6XOFRkL6gEGeykgQ1YDCueH8G36pNWcoPZYMfIRI83igGC To186TzNv8duKxS1/vXxeI6XmE/EZsYplwj8G5Jsdap6lPmzYbAz1qT9gF6y0BV7d+OV 20PG/yWIz7saAskUYWCMVzBwr65xdldDOzb4MGgCwFd1rE2LW42/Fr1+FtGyn/pTiAlR 8N0rRstpqukz1SoERuCVug8Qf/Gfyvh+m8FZq8omnfZ1wJ8KW/Kzd2VgIGNOPEBFnYyG hPDg== X-Forwarded-Encrypted: i=1; AJvYcCXLR2BWjrbym5HkTW9CGPjNaRNwukW2qEx5fnpxc+QeKt96OzrsBJgTWni0idM3rkNjqDg2lg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yyq9oQoGQgDeaTJQGrPdnJsTB93FoTxBizJF6+V58SVK27yHHd3 KXNxvXlikMcR8dRFst0kjBoQjvxx/Yi0+b3id71fJgNAKuBG4XoVMxMZCTFGdHbMAMiOebImBC/ zGJT4DKYyXcIRI+7AZLPC7YNSaUk= X-Gm-Gg: ASbGncs12Nn7QKML9sIXmxBGEabANboRU5bai9iAW9VYEjL0jTpOYv2IZ9PAZ1WVIqG CtSngKcla3V3pdoargqel6hbJZINrqIXfHcgPaihl X-Google-Smtp-Source: AGHT+IGFrYE+BgNZr4j+SNlaMQ3GcZwGvnZEntBTp2+UR7nPCRD35fAVUJSS281ZxOdIzWACmIuNbPhaTE0RCDQya6o= X-Received: by 2002:a05:6402:254b:b0:5d8:a46f:110b with SMTP id 4fb4d7f45d1cf-5d972e17033mr12574506a12.17.1736558448334; Fri, 10 Jan 2025 17:20:48 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 11 Jan 2025 01:20:48 +0000 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Sat, 11 Jan 2025 01:20:48 +0000 X-Gm-Features: AbW1kvYJZX6tgnb5DpNvAbsR6Un17lSUmy3Q9eSYfR81mXQE1YF9PS6_XZcTxpY Message-ID: Subject: Re: bug#75442: 31.0.50; c-ts-mode indentation problem To: =?UTF-8?Q?Uygar_K=C3=96SEER?= , 75442@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75442 Cc: Theodor Thornhill X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Uygar K=C3=96SEER writes: > Hi, > > I started to use c-ts-mode (tree-sitter) and I think there is a little > indentation problem when typedef declaration is used. > > Wrong indentation case: > > typedef struct Point > { > int x; > int y; > } Point; > > I think this happens because it aligns it with the struct keyword. > > Working case: > typedef struct Point Point; > struct Point > { > int x; > int y; > } Point; > > This case works without problem because the struct keyword is at the > beginning of the line. > > Both of the cases are matched with this part in c-ts-mode.el: > ((parent-is ,(rx (or "function_definition" > "struct_specifier" > "enum_specifier" > "function_declarator" > "template_declaration"))) > parent 0) > > I also tried to change this behaviour by adding new rules to my > c-ts-mode configuration but it always matches with the default > configuration first. I do not know if there is any way to change this > behaviour without re-defining all the default configuration. Theodor, any comments here? From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 13 01:25:52 2025 Received: (at 75442-done) by debbugs.gnu.org; 13 Jan 2025 06:25:52 +0000 Received: from localhost ([127.0.0.1]:49913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tXDtY-0001Oq-8L for submit@debbugs.gnu.org; Mon, 13 Jan 2025 01:25:52 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:57665) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tXDtW-0001Od-5w for 75442-done@debbugs.gnu.org; Mon, 13 Jan 2025 01:25:50 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21628b3fe7dso63930815ad.3 for <75442-done@debbugs.gnu.org>; Sun, 12 Jan 2025 22:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736749544; x=1737354344; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1WxaSQOA7hXYAfQbW9poXFJn+jXv5cXHgrEN1pd7Ngo=; b=L9EPMzGni2M+davY3fV6m23Oa2YSb7BDcZqUCwdJDhsMfewHdbCA4ZlphK0Ori96T8 AB4+lIDYtrUtANXP+kJLeXmx2kfdQRsiy+qL8DUY3XFqlI8G3I7L4Hdr7VwcsdjqXWhb wizSFVO/LGfRjBLZCFq6zn+OSntNLueiVH0PUIlEdf4JovAX7FAZXgak7bmVETeCJQz0 NRddHBuMAw8Blo+S0u+PmwDJwtJBNN+x14fPn9hIB5AkDhFaJYdIEblY7icAEFDGz3Xk 1SkobMGt6UWXRccV2MRtJf2yAp5Xy631z4wh9S3ETt5rOnKGMMpkSkbKrEsFZSGWIcTK vEog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736749544; x=1737354344; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1WxaSQOA7hXYAfQbW9poXFJn+jXv5cXHgrEN1pd7Ngo=; b=gyLdZcnzUSscuDQZRHZDpxRxsXb+z1ZStWLd4fKVlRG0pGa6XaKY8Owtn7TM4jRE4V O98hS1ILa33iluEAkGHapeasw8bKjdCybyI4zUDfvVIKEpx1KuCzAHHrzqD7IY6qeYbh Vp0I0dVdDIy8xwd4ZqDqqcMUgDsfLn/aHQOVEqBafSjLW9G6i0jeWkjFxcc4BIGUG3kW sK7cVM4qoqr8RU3MGfruBmc5fUamzW/M6X+lToclH3XDjsUHWDfr3SAWKOW8/RvxzZnm fXbr9bqpq8TuuaW4mCcZGXQ3vm55DpVk4XcN86vjV/FejFWgJ9ciITBFhaSGaGwgygPG f/fQ== X-Forwarded-Encrypted: i=1; AJvYcCWa3wqt2lYrA6BSGUCUuzA1c07Xzuxxku+BOavBHCf8U9GywsqRry28FtX9YPS9MOie4bAiauDPDAeQ@debbugs.gnu.org X-Gm-Message-State: AOJu0YyQRXw8MWr/PmaUPYckvDP03DcraDr1Wq28q4YnJPCFpdsvsYnp 2ErKgvi152TqrEvySJSlyKD14R6iBB7m6DYFQOKC6FOQTP4/0bHZ X-Gm-Gg: ASbGnctiDjkpNNqeeCOEfqULrEPsKn2qbh2IjG+WpeKo60+OcHGDOFi7QmyDtuV6FnB PH87qD24BGcrxuKpOVUEC7UKdOx44Y7Ra7eaRuj1dF1SQIud7EAcWO2USfyzxTxyfkujAzdcW/p qBEWXHX1q3JGFQ01NjZztYcjgVJ9K3UoZlMWfPduZxY1N8uX+fip0THoEka3MAZCacSJ0KuLKtL FVqZuJlJC6K8I3BMybADugXMd1Pfu2ShvYeAsHiXfXMr1DoNlEXqZzGzrHolkoyZ0HfRz4oVrTk 2OuA X-Google-Smtp-Source: AGHT+IFy1VX1Y50sKbCW6MCgobtnEDU/NbAh0O/jg9473gmm0rviC8+aVErm0/xKNdFPeyZu+k8wyw== X-Received: by 2002:a05:6a00:2c86:b0:726:41e:b313 with SMTP id d2e1a72fcca58-72d21fc659dmr24372333b3a.16.1736749544003; Sun, 12 Jan 2025 22:25:44 -0800 (PST) Received: from smtpclient.apple ([2601:646:8f81:6120:c04e:a612:3dd1:a163]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72d405489bdsm5163210b3a.33.2025.01.12.22.25.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jan 2025 22:25:42 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: bug#75442: 31.0.50; c-ts-mode indentation problem From: Yuan Fu In-Reply-To: Date: Sun, 12 Jan 2025 22:25:31 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <0886CE5F-6B38-422F-BF3D-B3A28E1DC1B3@gmail.com> References: To: Stefan Kangas X-Mailer: Apple Mail (2.3776.700.51) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 75442-done Cc: Theodor Thornhill , =?utf-8?Q?Uygar_K=C3=96SEER?= , 75442-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Jan 10, 2025, at 5:20=E2=80=AFPM, Stefan Kangas = wrote: >=20 > Uygar K=C3=96SEER writes: >=20 >> Hi, >>=20 >> I started to use c-ts-mode (tree-sitter) and I think there is a = little >> indentation problem when typedef declaration is used. >>=20 >> Wrong indentation case: >>=20 >> typedef struct Point >> { >> int x; >> int y; >> } Point; >>=20 >> I think this happens because it aligns it with the struct keyword. >>=20 >> Working case: >> typedef struct Point Point; >> struct Point >> { >> int x; >> int y; >> } Point; >>=20 >> This case works without problem because the struct keyword is at the >> beginning of the line. >>=20 >> Both of the cases are matched with this part in c-ts-mode.el: >> ((parent-is ,(rx (or "function_definition" >> "struct_specifier" >> "enum_specifier" >> "function_declarator" >> "template_declaration"))) >> parent 0) >>=20 >> I also tried to change this behaviour by adding new rules to my >> c-ts-mode configuration but it always matches with the default >> configuration first. I do not know if there is any way to change this >> behaviour without re-defining all the default configuration. >=20 > Theodor, any comments here? This is caused by some recent changes I made. I pushed a fix to master. Yuan= From unknown Wed Jun 18 23:14:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 10 Feb 2025 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator