From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Immanuel Litzroth Newsgroups: gmane.emacs.devel Subject: Re: New optimisations for long raw strings in C++ Mode. Date: Thu, 11 Aug 2022 08:27:48 +0200 Message-ID: References: <87fsi5xw9l.fsf@gnus.org> <83wnbhtlzb.fsf@gnu.org> <703c2351d96919276449@heytings.org> <83o7wsqlcm.fsf@gnu.org> <83edxoqcnl.fsf@gnu.org> <83a68cqbm0.fsf@gnu.org> <834jykq9m6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15713"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Alan Mackenzie , gregory@heytings.org, larsi@gnus.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 11 08:33:00 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oM1kZ-0003mn-Ee for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Aug 2022 08:32:59 +0200 Original-Received: from localhost ([::1]:57616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM1kY-0005l1-3f for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Aug 2022 02:32:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM1gD-00036f-6a for emacs-devel@gnu.org; Thu, 11 Aug 2022 02:28:29 -0400 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:42713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM1gB-0000Ad-KQ; Thu, 11 Aug 2022 02:28:28 -0400 Original-Received: by mail-lj1-x233.google.com with SMTP id v10so14844841ljh.9; Wed, 10 Aug 2022 23:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=9ohbwNtnHb1mXXttfx/dkq9x7o8p9thNqND4pGWKx9Y=; b=mUTQVHx/u50rvceJtbdo/51SiY9e08GAVEHIvWf359G1fU9YO8S1860DBjLIg4m8Ty x7MVlRn0t2AvIUDqfaP92bUxXuYPxEmFd4AVdlLt4amz7Ctb0YuJ/91UoxDzkq4/GSN4 New2LRbIsBAkD3XH9t/RFbR2aNbHF9fm0TnK2q/sXHv9f3VAmQJgjsoogFwz8WVgdeZw tDCdFPJhQHGsnxZXp3K3IBBq2dKE9+JfXso46R9ABTDliatKevfW08irnKl5RJTWj5WS eY30Kvb5gbup63w5nLFp5D/HX3PDiuGfld2APM9i4G8EDjP1p/gciPgsyYADg9CKMhHN kcaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=9ohbwNtnHb1mXXttfx/dkq9x7o8p9thNqND4pGWKx9Y=; b=PXkOwsX+OgY20I2oRJRn7TL8sFt55vVTdMP7RsQQpV+AA+rwYN6Tnteb2QtH/p/xeX Fn8CCMDAbMq2JXOjoGAwqCx9/T2Y5fbEWQHuMnhmYpan/bwpFjn5BVodtL6dNTIz0jrP rp92pRUbmTgjAvKzPFT4Zri8mlCaUFaYnV2GWmjcvJt5SbP9ITcEnJS9UIWy7dVLRzMV EA+34fp/BPE8AOWOs4e0lB9DfinEiJje4+8Ycr2hYThXKKH2o41Ri8MsKXD7mmkdmpOV WcPETr3FB0z0wFtfYkxKa/1yARP20zIp8uedS7JG/RVeCmIplrEQC2oc+P9S9Upu9gLO FqAg== X-Gm-Message-State: ACgBeo3QZd6aJXqkSpjROw1DtVTli3KKKMu++CD8//A1qR5y/dYDw0VN 3jPP7od/N1UyVqbFOBKFO/LavbPagp2G+tSFOg== X-Google-Smtp-Source: AA6agR6gayzMfGN3qMIboiVVKdMA3oSa2/R94Dwsn0PQy+asdnc5WpzB3+W9WoeLGnOWLgrNpy6K4kfO+tUlWnmaHkA= X-Received: by 2002:a2e:7317:0:b0:25e:50c5:f248 with SMTP id o23-20020a2e7317000000b0025e50c5f248mr9290114ljc.469.1660199304539; Wed, 10 Aug 2022 23:28:24 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=immanuel.litzroth@gmail.com; helo=mail-lj1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293372 Archived-At: On Thu, Aug 11, 2022 at 12:32 AM Stefan Monnier wrote: > > > Really? Then please tell me how is it that we the humans can detect > > incorrect fontifications even when shown partial strings and comments? > > That's usually because we can tell the difference between valid C code > and human text and then based on that we can heuristically guess whats > comment/strings/code. > Our guesses can be wrong, tho. And making such a guess without some > AI-style thingy is somewhat difficult. Hear, hear. Although even AI will not be able to do that well given that any block of C code might be inside a comment that's inside a raw string... Also I've seen some people suggesting that treesitter might be a solution. I did check treesitters c++ parsing earlier this year and the syntactic information it gave was just not detailed enough to do much with. A happy CC mode user, Immanuel -- -- A man must either resolve to point out nothing new or to become a slave to defend it. -- Sir Isaac Newton