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:21:46 -0800 Message-ID: <49C8837A-A6D3-4ABF-BC3B-97ECE925F85C@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> <837czgrh9y.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36738"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dev@rjt.dev, aqua0210@foxmail.com, Stefan Monnier , 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 23:22:20 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 1ozQ2W-0009Kl-Ba for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 23:22:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozQ2H-0005Yo-9j; Sun, 27 Nov 2022 17:22:05 -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 1ozQ2G-0005Yf-B8 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 17:22:04 -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 1ozQ2G-0001kT-05 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 17:22:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozQ2E-0001VL-2e for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 17:22: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:22: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.16695877165777 (code B ref 59498); Sun, 27 Nov 2022 22:22:02 +0000 Original-Received: (at 59498) by debbugs.gnu.org; 27 Nov 2022 22:21:56 +0000 Original-Received: from localhost ([127.0.0.1]:44530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozQ27-0001V7-Ls for submit@debbugs.gnu.org; Sun, 27 Nov 2022 17:21:56 -0500 Original-Received: from mail-pf1-f176.google.com ([209.85.210.176]:36651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozQ25-0001V1-Me for 59498@debbugs.gnu.org; Sun, 27 Nov 2022 17:21:54 -0500 Original-Received: by mail-pf1-f176.google.com with SMTP id x66so8792638pfx.3 for <59498@debbugs.gnu.org>; Sun, 27 Nov 2022 14:21:53 -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=S2A8+qKgH/4X0CZNmT6ZfYREIBE22qsecPUDW0kALhk=; b=jROT1AKez/y8EuyvCIv5ThjrN0eIpXcF7+4oBzoaTEe5AztD+lu5hl9StM6wISHwG7 mnEK9woXwRpfo9RIdi587INPjWP81gk1QDb2w389vfNSWk8MQLSCp2iaOLfElBX9d7X/ v/ui43HQALUN97ALv/IclRKKtXheTO0aA0sbmDmM0d62aa+sylrhCgs7f2TKn9mq2Kow v9JVv+XiCkfMW0BxWAMpcRoOuHstFeuAkxQyJFgzbH+USTRAldj+TDUXra7tkiTPXISV lCR69AHdD6jXAO8edj3LkwAgNhv/R20yZGLiSQvzaab/wX6tkdgjbx6aHSKGCWiQORA7 ESag== 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=S2A8+qKgH/4X0CZNmT6ZfYREIBE22qsecPUDW0kALhk=; b=O6xK5/jNuqKLryAEeCJit3ZKEpt6b2L6tM7wH1g0/vZe9175ZZe/SAW55nJ94HxraD B8fOb6DNIXv3rDKuflahNk+IrVX14yXsmo1kxCRCE+EagBQit/Q195J3Lb2viT/D1LZP uSmvX8vHdFpnHB2NmCE0zQqipzkZcfdrb+bF0vBkkJuzs2hv9fi+A4wuDZG1kOb4TpHP m2+rxKad8UlGHws+tG9RgB8D+YVJPK/1I2/zpHdhip6YpRWZnJR4U2NkzRYE/SbP2OBm AB2z42Cvqr4WuYYw2MTtWRecYV7fSh3aUvzR2Z+FV5gJF9MII1qIQuLnZ63jUVw5HMZ1 pHxw== X-Gm-Message-State: ANoB5pl64MKgLFL1079MayiimEgkAoY5osdADkZf+Fj7GpPzt0YQwlyF 9MlG9Cc0SY/MRpCTXH3Snx0= X-Google-Smtp-Source: AA0mqf6oumB88oZxtdWI/+ZesDrWWycoPcKCQmi7y+0M1sA523z71VP0L1JvcTDJGgOa1ltlj0k1Ug== X-Received: by 2002:a63:711e:0:b0:477:5654:c37e with SMTP id m30-20020a63711e000000b004775654c37emr33169807pgc.206.1669587707797; Sun, 27 Nov 2022 14:21:47 -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 17-20020a170902c11100b001766a3b2a26sm7295557pli.105.2022.11.27.14.21.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2022 14:21:47 -0800 (PST) In-Reply-To: <837czgrh9y.fsf@gnu.org> 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:249252 Archived-At: > On Nov 26, 2022, at 11:24 PM, Eli Zaretskii wrote: >=20 >> 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 >>=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. >>=20 >> 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. >=20 > OK, but do you agree that adding yet another pair of variables, > treesit-comment-start/end, is the opposite of what we want? Yes. I removed them in d5dc1dbf7cb. Yuan=