[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabl
From: |
Eli Zaretskii |
Subject: |
bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled |
Date: |
Sun, 27 Nov 2022 09:24:57 +0200 |
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Yuan Fu <casouri@gmail.com>, dev@rjt.dev, aqua0210@foxmail.com,
> 59498@debbugs.gnu.org, mardani29@yahoo.es
> Date: Sun, 27 Nov 2022 02:18:06 -0500
>
> >> 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.
> >
> > ??? This is surprisingly unclean, IMO. For starters, the names of the
> > variables are confusing. The need to define two sets of comment-start and
> > comment-end regexps is also a nuisance and a source of errors.
> >
> > How do non-treesit modes handle this issue? Why do the treesit-based modes
> > need something special here?
> >
> > Stefan, any ideas?
>
> `comment-start` and `comment-end` do not describe the set of possible
> comment delimiters. They describe the comment delimiters that should be
> *inserted* when we do things like `comment-dwim`.
>
> To find/match comment delimiters we have `comment-start-skip` and
> `comment-end-skip`. They're not ideal, but they've been good enough so far.
> They don't say which comment starter matches which comment-ender (that
> was done by the syntax-tables), but tree-sitter should be able to tell
> us that when we need it.
>
> It would be nice if we could avoid the need to set/use
> `comment-start-skip` and `comment-end-skip` when using tree-sitter.
> Maybe we can compute their values from the tree-sitter grammar.
> But getting rid of uses of those vars will take a fair bit more work,
> I think.
OK, but do you agree that adding yet another pair of variables,
treesit-comment-start/end, is the opposite of what we want?
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Eason Huang, 2022/11/22
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Daniel MartÃn, 2022/11/23
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Eason Huang, 2022/11/23
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Randy Taylor, 2022/11/24
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Eason Huang, 2022/11/25
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Eli Zaretskii, 2022/11/26
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Yuan Fu, 2022/11/26
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Eli Zaretskii, 2022/11/27
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Stefan Monnier, 2022/11/27
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled,
Eli Zaretskii <=
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Yuan Fu, 2022/11/27
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Stefan Kangas, 2022/11/27
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Eason Huang, 2022/11/28
- bug#59498: 29.0.50; c++-ts-mode get wrong-type-argument error when enabled, Yuan Fu, 2022/11/27