GNU bug report logs - #59498
29.0.50; c++-ts-mode get wrong-type-argument error when enabled

Previous Next

Package: emacs;

Reported by: Eason Huang <aqua0210 <at> foxmail.com>

Date: Wed, 23 Nov 2022 02:26:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Fixed in version 29.1

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #22 received at 59498 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Randy Taylor <dev <at> rjt.dev>, Yuan Fu <casouri <at> gmail.com>
Cc: aqua0210 <at> foxmail.com, 59498 <at> debbugs.gnu.org, mardani29 <at> yahoo.es
Subject: Re: bug#59498: 29.0.50;
 c++-ts-mode get wrong-type-argument error when enabled
Date: Sat, 26 Nov 2022 13:18:01 +0200
> Cc: Yuan Fu <casouri <at> gmail.com>, 59498 <at> debbugs.gnu.org,
>  Daniel Martín <mardani29 <at> yahoo.es>
> Date: Thu, 24 Nov 2022 14:39:19 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> 
> diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
> index fc35d9aedda..48f504214e2 100644
> --- a/lisp/progmodes/c-ts-mode.el
> +++ b/lisp/progmodes/c-ts-mode.el
> @@ -570,6 +570,8 @@ c++-ts-mode
>    (setq-local comment-start "// ")
>    (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *")
>    (setq-local comment-end "")
> +  (setq-local treesit-comment-start (rx "/" (or (+ "/") (+ "*"))))
> +  (setq-local treesit-comment-end (rx (+ (or "*")) "/"))
>  
>    (treesit-parser-create 'cpp)

Thanks, but this doesn't look right to me: why should c++-ts-mode set
variables for treesit.el?  It is more likely that treesit.el should use the
buffer-local values of comment-start and comment-end instead, and fall back
on generic values (if they make sense) only if the local values are not set.

Yuan, WDYT?




This bug report was last modified 2 years and 231 days ago.

Previous Next


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