From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 02:18:06 -0500 Message-ID: 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> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3206"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dev@rjt.dev, Yuan Fu , aqua0210@foxmail.com, 59498@debbugs.gnu.org, mardani29@yahoo.es To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 08:21:54 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 1ozBz7-0000cf-2P for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 08:21:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozByV-0000tR-MN; Sun, 27 Nov 2022 02:21:15 -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 1ozByQ-0000pQ-SH for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 02:21:11 -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 1ozByN-0001Ff-JP for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 02:21:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozBwM-0007Nn-Eb for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 02:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 07:19:02 +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.166953349728370 (code B ref 59498); Sun, 27 Nov 2022 07:19:02 +0000 Original-Received: (at 59498) by debbugs.gnu.org; 27 Nov 2022 07:18:17 +0000 Original-Received: from localhost ([127.0.0.1]:41993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozBvc-0007NW-Rf for submit@debbugs.gnu.org; Sun, 27 Nov 2022 02:18:17 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozBva-0007NP-Dk for 59498@debbugs.gnu.org; Sun, 27 Nov 2022 02:18:15 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C3A741000FB; Sun, 27 Nov 2022 02:18:08 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 307B51000D2; Sun, 27 Nov 2022 02:18:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1669533487; bh=sw1ABnVXsD2mUi5UZNLzRnhIDh5CQHEJwejqPYRqIxQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YTO/SdAtQFcycMplkZ4BfaAOLzkPjHTkQk9Ez60C9Ue/LwSQonySl1Qt1dfEi8qUb qoOsVe84INw6WesW24bJlz6bos4Y42brKsmoMBx/YllTQEIn9roa3ZWW6FggD01dmz tTYSLy/AztfkxG9zVMk4T2H9Ep4Vvqe9AU4VdONq53wcOhHZZLmd1aOZppBqo8/CkH nUZcqnGKbXstA0muD2DdT+qq38yhEpv5ZH78w3KrPwfdLKXnX0qMhJ9ZxkOhH580ks kPOFAESkK9paednU6cxD3AKmeE7bALYCpacYJVEhLrzkKbAVeiIjJ+VXEIfg0Ciuze 1eQRKvmV6oN0A== Original-Received: from pastel (unknown [104.247.241.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BAA05120F97; Sun, 27 Nov 2022 02:18:06 -0500 (EST) In-Reply-To: <83ilj0rk2y.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Nov 2022 08:24:21 +0200") 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:249179 Archived-At: >> 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. Stefan