From: Eli Zaretskii <eliz@gnu.org>
To: Yuan Fu <casouri@gmail.com>
Cc: 60888@debbugs.gnu.org, juri@linkov.net, dgutov@yandex.ru
Subject: bug#60888: 29.0.60; Lost c-or-c++-ts-mode
Date: Fri, 20 Jan 2023 10:38:28 +0200 [thread overview]
Message-ID: <838rhxob23.fsf@gnu.org> (raw)
In-Reply-To: <36C3AE10-1F2E-428D-AE5B-2ADF1732433C@gmail.com> (message from Yuan Fu on Thu, 19 Jan 2023 13:57:17 -0800)
> Cc: 60888@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
> From: Yuan Fu <casouri@gmail.com>
> Date: Thu, 19 Jan 2023 13:57:17 -0800
>
>
> Dmitry Gutov <dgutov@yandex.ru> writes:
>
> > On 17/01/2023 19:20, Juri Linkov wrote:
> >> I started to rely on c-or-c++-ts-mode because there is no other replacement
> >> to use for such mappings in init files:
> >> (when (and (treesit-ready-p 'c t) (treesit-ready-p 'cpp t))
> >> (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode)))
> >> c-or-c++-mode is activated for all .h files, so there should be the
> >> corresponding
> >> c-or-c++-ts-mode, but it's lost somewhere in emacs-29.
> >
> > Apparently it was decided that it's a new feature, and thus too late
> > for emacs-29.
>
> I added it back. It really is a bug preventing one to use c(++)-ts-mode
> on header files. So this should be fine to add. Plus I mostly just
> copy-pasted from cc-mode. Sorry for the back-and-forth.
Yuan, something is still amiss here: there's a difference in the
decision whether C or C++ mode should be used between c-or-c++-mode
and c-or-c++-ts-mode. For example, visit the file
dwarf2/line-header.h file from the recent GDB tree: c-or-c++-mode
decides (correctly) that it's C++, but c-or-c++-ts-mode decides that
it's C.
In general, try header files from GDB: GDB is written in C++, but many
*.h files kept their original *.h names, so you have a lot of testing
cases there. I see quite a few of them where c-or-c++-ts-mode decides
incorrectly for some reason.
Thanks.
next prev parent reply other threads:[~2023-01-20 8:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 17:20 bug#60888: 29.0.60; Lost c-or-c++-ts-mode Juri Linkov
2023-01-17 18:22 ` Dmitry Gutov
2023-01-19 21:57 ` Yuan Fu
2023-01-20 7:57 ` Juri Linkov
2023-01-20 8:38 ` Eli Zaretskii [this message]
2023-01-20 22:19 ` Yuan Fu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=838rhxob23.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=60888@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=dgutov@yandex.ru \
--cc=juri@linkov.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).