From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <837czgrh9y.fsf@gnu.org> References: <6_5zC6qq_eQV2whwZ7epZMUlEN-yk5iOlJBLuVnNDLzl4RUGCPFnbIN12pG-DyNvCAYlRJTTopEe_RxX2_B7nSJQyBCJrzo915uBA51qW8A=@rjt.dev> <838rjyt15i.fsf@gnu.org> <5ADA88E0-A105-47B5-B590-2591253781C1@gmail.com> <83ilj0rk2y.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dev@rjt.dev, casouri@gmail.com, aqua0210@foxmail.com, 59498@debbugs.gnu.org, mardani29@yahoo.es To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 08:25:28 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozC2a-0004qx-5w for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 08:25:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozC2H-0001uY-5M; Sun, 27 Nov 2022 02:25:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozC2A-0001uJ-BA for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 02:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozC2A-0001h1-1g for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 02:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozC29-0007Rv-Sp for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 02:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 07:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59498 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59498-submit@debbugs.gnu.org id=B59498.166953388128624 (code B ref 59498); Sun, 27 Nov 2022 07:25:01 +0000 Original-Received: (at 59498) by debbugs.gnu.org; 27 Nov 2022 07:24:41 +0000 Original-Received: from localhost ([127.0.0.1]:42007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozC1p-0007Rc-8y for submit@debbugs.gnu.org; Sun, 27 Nov 2022 02:24:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37894) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozC1o-0007RW-0N for 59498@debbugs.gnu.org; Sun, 27 Nov 2022 02:24:40 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozC1g-0001g6-Hu; Sun, 27 Nov 2022 02:24:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=S2LAdz0BJoChxACWW7zJ4criJLxS4g00Q1tpD0JQZiA=; b=P0j5JPzgft5j gsd3tjMPl7w2V+U3vlyVXXfFfqkUiglLyM/0M/swRJ8zyLcEOrPnOMZa/ABG2dWlA9q0NU0Nvnyup Iw8O8FMcN7RpuYv0fzdMMqNTYlW1Aaby7kK+rAlAy7BnwIbtuUnnDwobMkrv0PMY94sXW5DuxYEkf zS/0W9O5L0gsnfK7+wJPO6ChvQVpxVQF8ykNgLZ4j4YZKkHDnxBD1GnSs82Jlt56pQoxRbDUthKVT LO/yLII+iZkJ5l4J4j8nP4svTGeI7IKBPFVY979u/L28eHZwa3tFCb8i+uCV4nX1/o6+e8UrbwXRC d38okYIiW7zQHiTBVJZhRQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozC1e-0007Hb-OJ; Sun, 27 Nov 2022 02:24:31 -0500 In-Reply-To: (message from Stefan Monnier on Sun, 27 Nov 2022 02:18:06 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249183 Archived-At: > From: Stefan Monnier > Cc: Yuan Fu , 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?