From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arteen Abrishami via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67417: 29.1.50; c-ts-mode syntax issues with no brackets Date: Thu, 23 Nov 2023 12:55:31 -0800 Message-ID: Reply-To: Arteen Abrishami Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.200.91.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12996"; mail-complaints-to="usenet@ciao.gmane.io" To: 67417@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 23 23:00:19 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 1r6HkA-00038r-6o for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 Nov 2023 23:00:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6Hjt-0006m7-TN; Thu, 23 Nov 2023 17:00:02 -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 1r6Hjr-0006ku-IU for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2023 17:00:00 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6Hjr-0007ql-Af for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2023 16:59:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6Hjv-0001rL-Bt for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2023 17:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Arteen Abrishami Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Nov 2023 22:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67417 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17007767907072 (code B ref -1); Thu, 23 Nov 2023 22:00:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Nov 2023 21:59:50 +0000 Original-Received: from localhost ([127.0.0.1]:35282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6Hjg-0001py-Nn for submit@debbugs.gnu.org; Thu, 23 Nov 2023 16:59:49 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:45644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6Gjt-0008NF-4c for submit@debbugs.gnu.org; Thu, 23 Nov 2023 15:55:57 -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 1r6Gjj-0003lW-DC for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2023 15:55:47 -0500 Original-Received: from linux.ucla.edu ([131.179.104.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6Gjh-00071F-9r for bug-gnu-emacs@gnu.org; Thu, 23 Nov 2023 15:55:47 -0500 Original-Received: from smtpclient.apple (cpe-70-95-151-149.san.res.rr.com [70.95.151.149]) by linux.ucla.edu (Postfix) with ESMTPSA id 09F4BEC108E for ; Thu, 23 Nov 2023 12:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.ucla.edu; s=mail; t=1700772942; bh=y5qRP2GrnqFYop10wvABWAO2WtnmJ4+l2ZcrKoWOK5c=; h=From:Subject:Date:To:From; b=SlRRpoB2Y5zv+3doMmX9eKbLsRRvOfoRUd8fWQpi3oim+rv7Q+FHRdxeJtEgN99QV +95Cd2IzASXfINOP3fZ7QuFsaye6irPZ5WeGnodY+feFy8BOXoz2ymvun73TwuSwU9 nyyuRhZoPcFuqRvt0dd5WVz6NT+Ib1wKhNKITjbg5EbBYh/g3Zk8SCIlG8Ntga2vD4 HHQP9z/M9g868jQ6k7z6TvNL5aL//MQmBMB+ZjVKh5ASpisLD/cjdYjEWoB3dDvfHJ NiyRU41CfQlideXlNtSZM1zuI5gAYu7pmTERWSkc78YSnQGKv08pFaWbXXZ0L9LHk1 HxuotBQJjpSNA== X-Mailer: Apple Mail (2.3774.200.91.1.1) Received-SPF: pass client-ip=131.179.104.10; envelope-from=arteen@linux.ucla.edu; helo=linux.ucla.edu X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 23 Nov 2023 16:59:44 -0500 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:274835 Archived-At: This is specifically for the usage of `c-ts-mode` and is not a problem in `c-mode`. Sometimes, when you type something like: else break it won't indent the "break" until you type a semicolon. In this below scenario, it does not indent the break at all, but `c-mode` does, and switching from `c-mode` to `c-ts-mode` with correct indentation leaves it fixed, but `c-ts-mode` cannot detect or fix it itself. You can put it into a `.c` buffer all by itself and see: ``` unsigned heap_pop(struct heapq * heap) { if (heap->sz =3D=3D 0) return -1; unsigned ret_val =3D heap->vals[0]; heap->vals[0] =3D heap->vals[heap->len]; heap->len -=3D 1; unsigned i =3D 0; unsigned lc; while ((lc =3D HEAPQ_L_CHILD(i)) < heap->len) { unsigned rc =3D HEAPQ_R_CHILD(i); /* no right child for our guy, special case */ =20 if (rc =3D=3D heap->len) { if (heap->vals[lc] < heap->vals[i]) SWAP(heap->vals[lc], heap->vals[i]); break; } if (heap->vals[lc] < heap->vals[i]) { SWAP(heap->vals[lc], heap->vals[i]); i =3D lc; } else if (heap->vals[rc] < heap->vals[i]) { SWAP(heap->vals[rc], heap->vals[i]); i =3D rc; } else break; =20 } } ``` The very last break on the else without brackets around it will not = indent.c In GNU Emacs 29.1.50 (build 2, x86_64-apple-darwin23.0.0, NS appkit-2487.00 Version 14.0 (Build 23A344)) of 2023-09-30 built on Arteens-MacBook-Pro.local Repository revision: 63ec6d998d42c970a825dca17743ece9c651d929 Repository branch: emacs-29 Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14.1.1 Configured using: 'configure --with-native-compilation=3Daot --without-pop --with-tree-sitter --with-json 'CFLAGS=3D-O2 -pipe' = CPPFLAGS=3D-I/usr/local/opt/openjdk/bin:/usr/local/opt/openjdk/bin:/usr/lo= cal/opt/make/libexec/gnubin:/usr/local/opt/python@3.11/libexec/bin:/usr/lo= cal/sbin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local= /bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/= com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/= com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.ap= ple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Librar= y/Apple/usr/bin:/Library/TeX/texbin' Configured features: ACL GIF GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: C/* Minor modes in effect: override-global-mode: t windmove-mode: t winner-mode: t delete-selection-mode: t global-auto-revert-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t hs-minor-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search 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-mode c-ts-common treesit misearch multi-isearch time-date comp comp-cstr warnings icons vc-git diff-mode vc-dispatcher cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs hideshow dired-subtree dired-hacks-utils dired dired-loaddefs dash edmacro kmacro use-package-bind-key bind-key easy-mmode rx doom-themes-ext-org doom-themes-ext-visual-bell face-remap doom-vibrant-theme doom-themes doom-themes-base exec-path-from-shell cl-extra help-mode use-package-ensure use-package-core windmove winner ring delsel autorevert filenotify dired-sidebar-autoloads dired-subtree-autoloads dired-hacks-utils-autoloads info dash-autoloads doom-themes-autoloads exec-path-from-shell-autoloads expand-region-autoloads package browse-url 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 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/ns-win ns-win ucs-normalize mule-util term/common-win 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 kqueue cocoa ns lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 240395 9962) (symbols 48 13899 0) (strings 32 41716 3048) (string-bytes 1 1380541) (vectors 16 26557) (vector-slots 8 519687 16325) (floats 8 260 374) (intervals 56 5432 0) (buffers 984 16))