unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Theodor Thornhill <theo@thornhill.no>
Cc: dianchengwang@gmail.com, casouri@gmail.com, 64818@debbugs.gnu.org
Subject: bug#64818: 30.0.50; c++-ts-mode highlight does not work
Date: Mon, 24 Jul 2023 21:08:48 +0300	[thread overview]
Message-ID: <83mszlqj0v.fsf@gnu.org> (raw)
In-Reply-To: <87mszl5j30.fsf@thornhill.no> (message from Theodor Thornhill on Mon, 24 Jul 2023 19:13:07 +0200)

> From: Theodor Thornhill <theo@thornhill.no>
> Cc: 64818@debbugs.gnu.org, dianchengwang@gmail.com
> Date: Mon, 24 Jul 2023 19:13:07 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Can you show the patch?
> >
> 
> diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
> index 7f4f6f11387..98797bf3ce7 100644
> --- a/lisp/progmodes/c-ts-mode.el
> +++ b/lisp/progmodes/c-ts-mode.el
> @@ -574,9 +574,7 @@ c-ts-mode--font-lock-settings
>     :feature 'constant
>     `((true) @font-lock-constant-face
>       (false) @font-lock-constant-face
> -     (null) @font-lock-constant-face
> -     ,@(when (eq mode 'cpp)
> -         '((nullptr) @font-lock-constant-face)))
> +     (null) @font-lock-constant-face)
>  
>     :language mode
>     :feature 'keyword

Thanks, please install this on the emacs-29 branch.

> > What about catching errors inside treesit.c or treesit.el, so that the
> > features that disappeared and queries that fail don't fail the entire
> > font-lock?  Would that work, or at least make Emacs more robust in the
> > face of such changes?
> >
> > Yuan, WDYT?
> >
> > (This more robust approach is certainly not for Emacs 29.1, even if we
> > agree that it's a good idea.)
> 
> I'll defer that to Yuan, as I'm not 100% on where such errors can be
> caught, and if it can make the parser enter some state it shouldn't be
> in.

AFAIU, it isn't the parser that signaled an error, it's our code which
queried tree-sitter about a node that doesn't exist.





  reply	other threads:[~2023-07-24 18:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24  4:49 bug#64818: 30.0.50; c++-ts-mode highlight does not work Wang Diancheng
2023-07-24 11:54 ` Eli Zaretskii
2023-07-24 13:10   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-24 13:26   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-24 13:46     ` Eli Zaretskii
2023-07-24 14:31       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-24 16:08         ` Eli Zaretskii
     [not found]           ` <9173CE5D-08AE-4BF3-AD37-3B521845F8AC@thornhill.no>
2023-07-24 16:56             ` Eli Zaretskii
2023-07-24 17:13               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-24 18:08                 ` Eli Zaretskii [this message]
2023-07-24 18:22                   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-16  6:14                 ` Yuan Fu
2023-07-24 20:33               ` Dmitry Gutov

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=83mszlqj0v.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64818@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=dianchengwang@gmail.com \
    --cc=theo@thornhill.no \
    /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).