unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Randy Taylor <dev@rjt.dev>,
	aqua0210@foxmail.com, 59498@debbugs.gnu.org, mardani29@yahoo.es
Subject: bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled
Date: Sat, 26 Nov 2022 14:11:48 -0800	[thread overview]
Message-ID: <5ADA88E0-A105-47B5-B590-2591253781C1@gmail.com> (raw)
In-Reply-To: <838rjyt15i.fsf@gnu.org>



> On Nov 26, 2022, at 3:18 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> Cc: Yuan Fu <casouri@gmail.com>, 59498@debbugs.gnu.org,
>> Daniel Martín <mardani29@yahoo.es>
>> Date: Thu, 24 Nov 2022 14:39:19 +0000
>> From: Randy Taylor <dev@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?

I added treesit-comment-start/end to help indenting comments. So this is the correct way to use them. The following comment explains why I created new variables:

;; `comment-start' and `comment-end' assume there is only one type of
;; comment, and that the comment spans only one line.  So they are not
;; sufficient for our purpose.

Yuan




  reply	other threads:[~2022-11-26 22:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  2:24 bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled Eason Huang
2022-11-23  8:44 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 10:53   ` Eason Huang
2022-11-24 14:39     ` Randy Taylor
2022-11-25 12:56       ` Eason Huang
2022-11-26 11:18       ` Eli Zaretskii
2022-11-26 22:11         ` Yuan Fu [this message]
2022-11-27  6:24           ` Eli Zaretskii
2022-11-27  7:18             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-27  7:24               ` Eli Zaretskii
2022-11-27 22:21                 ` Yuan Fu
2022-11-28  0:24                   ` Stefan Kangas
2022-12-18  9:57                     ` Eli Zaretskii
2022-12-18 22:49                       ` Yuan Fu
2022-12-19 13:51                         ` Eli Zaretskii
2022-12-20  1:56                           ` Yuan Fu
2022-12-20 15:18                             ` Eli Zaretskii
2022-12-21  0:37                               ` Yuan Fu
2022-11-28 13:59                   ` Eason Huang
2022-11-27 22:00               ` Yuan Fu
     [not found] <m24juq9zn6.fsf@foxmail.com>
2022-11-30 21:33 ` 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=5ADA88E0-A105-47B5-B590-2591253781C1@gmail.com \
    --to=casouri@gmail.com \
    --cc=59498@debbugs.gnu.org \
    --cc=aqua0210@foxmail.com \
    --cc=dev@rjt.dev \
    --cc=eliz@gnu.org \
    --cc=mardani29@yahoo.es \
    /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).