From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu 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 14:00:41 -0800 Message-ID: <9639B940-24CA-4105-85AF-3BBC1EAEFDC6@gmail.com> 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> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16170"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Randy Taylor , Eli Zaretskii , 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 23:01:25 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 1ozPiH-0003zW-8Q for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 23:01:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozPhw-0000ON-0V; Sun, 27 Nov 2022 17:01:04 -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 1ozPhu-0000Ns-HO for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 17:01: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 1ozPhu-0007Gu-89 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 17:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozPhu-0001Mh-3b for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 17:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 22:01: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.16695864535233 (code B ref 59498); Sun, 27 Nov 2022 22:01:02 +0000 Original-Received: (at 59498) by debbugs.gnu.org; 27 Nov 2022 22:00:53 +0000 Original-Received: from localhost ([127.0.0.1]:44449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozPhk-0001ML-KA for submit@debbugs.gnu.org; Sun, 27 Nov 2022 17:00:52 -0500 Original-Received: from mail-pg1-f172.google.com ([209.85.215.172]:37394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozPhi-0001MF-PS for 59498@debbugs.gnu.org; Sun, 27 Nov 2022 17:00:51 -0500 Original-Received: by mail-pg1-f172.google.com with SMTP id v3so8343948pgh.4 for <59498@debbugs.gnu.org>; Sun, 27 Nov 2022 14:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/SpINPLfVtMZvn7avDt6qmoK1Pm/rDzz5vkVt2c28Ew=; b=gNpk4Q61Y0mcDipOUhEkRBPme9pvb1cMVLDFihcY7gcnvWn51YnGUt841621k+e44l r9Z+2D7qnJtL28zCm34engIiVOHODL9cz62EXUZs+W4D10CDSuTBMmfbpkmhi/Rdkqjl J5bCKt6T65307mQJ8ZteEqjNz25xZqMzoeoh0t1a3io2HrEU0teMNDOIeHaQiIzxq0s5 FqyIjr0R8NXy+rLGKqv3Mrp/8BRZ6UpQWhnMyiZCnsRL9XMZazsn+5erHnhBHvUfbmoP gSruNGhch3hiEucPiFUlzufPdW8CO/3GASe/eoEbeYawO9LqGMmBSFlcaNRLbDmAWt0l lPDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/SpINPLfVtMZvn7avDt6qmoK1Pm/rDzz5vkVt2c28Ew=; b=KnTH3iitCbN5LErEJTCoPrVPz40taK9P14s5fNkw6hXFPGn3PadkR5iojBG+zdloyd vEb27swRIHvlFnodPJgPYHlb6C12LZhu8/JM1YG3XvYyGoexbN5v9pzoB62s4sktJ71A GR6cqqAP9arG6X1iLLamRUd7+f7ce9PWtP1O6nKhoGmRepjzRbLKRrzKv2w5flUo33Jr RvXMHBPeRkQ4g2AHFSe3lTIODyIwWK6Fbha2kAFEnW21XVOxX5dSN1gItQI9/pOxb0/q OEw+tdHKkESkfsZbcezgiMkYhuph9hoW5vC03a9+zclmDuvtS6W7fiWkAYqemRuGHhUL 4I6g== X-Gm-Message-State: ANoB5pnrCSdADeJVk04T8ACcQrLPl7/tcbO/nT8EphDNRmlgOgiB0vbr WtwmQWG43FEeruWqbymAU2E= X-Google-Smtp-Source: AA0mqf4G0wcEefejM0/t52zrB+KSdJlBByAxpH8GQiOXQvhdZiBgwoaCEbkwQiwFMvDUzgTE36MHmw== X-Received: by 2002:a63:5d45:0:b0:476:dd29:75a8 with SMTP id o5-20020a635d45000000b00476dd2975a8mr25165011pgm.547.1669586444944; Sun, 27 Nov 2022 14:00:44 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id h21-20020aa796d5000000b0056bad6ff1b8sm6596863pfq.101.2022.11.27.14.00.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2022 14:00:44 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) 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:249251 Archived-At: > On Nov 26, 2022, at 11:18 PM, Stefan Monnier = wrote: >=20 >>> 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: >>>=20 >>> ;; `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. >>=20 >> ??? 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. >>=20 >> How do non-treesit modes handle this issue? Why do the treesit-based = modes >> need something special here? >>=20 >> Stefan, any ideas? >=20 > `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`. >=20 > 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. Ah, I should=E2=80=99ve done more research, sorry. = comment-start/end-skip can completely replace treesit-comment-start/end. > 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. Tree-sitter puts the whole comment in a single =E2=80=9Ccomment=E2=80=9D = node, so there is no hope getting comment-start/end from it, sadly. Yuan=