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.devel Subject: Re: New optimisations for long raw strings in C++ Mode. Date: Thu, 11 Aug 2022 20:15:17 +0300 Message-ID: <835yiypuqi.fsf@gnu.org> References: <83wnbhtlzb.fsf@gnu.org> <703c2351d96919276449@heytings.org> <83o7wsqlcm.fsf@gnu.org> <83edxoqcnl.fsf@gnu.org> <83a68cqbm0.fsf@gnu.org> <834jykq9m6.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11335"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gregory@heytings.org, larsi@gnus.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 11 19:16:25 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 1oMBnE-0002kp-Km for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Aug 2022 19:16:24 +0200 Original-Received: from localhost ([::1]:38618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMBnD-0006Yv-0D for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Aug 2022 13:16:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMBmK-0005mX-5T for emacs-devel@gnu.org; Thu, 11 Aug 2022 13:15:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMBmG-0000id-40; Thu, 11 Aug 2022 13:15:26 -0400 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=ZokhQU1qdj7gWDvx1f1tt3B26gVIv2EuopmrlVfPPd0=; b=AnyPDYPhxq9F 0q/bSi9OiF0+KwxImvB9YwBlYYEf85w06lHK/zsLWrOlUOKAloWSPgsEdn1Jmmf1ameZVvjmRVR3f YtEgAFKrksvod9VAam0OzFrq6JGHtkFwxgqodp1T43K8DyohcFXa2MBvUbdIYVQwVJw3YEfsSxTOW Sc9T3S8ptyuhQWk6BCP598IQrpG8uM/XOr2vijkk9t92rHtFofQiFlL+jYbPnyeGBL1ZicA85eLIy htzq3YgqLibJ1tY1ZI/I+cxRGlTcF/p32v7ZaYMFLFGrk4WFBASilH7sZR9BLXYvWqFN3XbBAH3ej DkY5Xp9vVvgoGfJz9V3+OQ==; Original-Received: from [87.69.77.57] (port=1990 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 1oMBmF-00021x-Ny; Thu, 11 Aug 2022 13:15:23 -0400 In-Reply-To: (message from Alan Mackenzie on Thu, 11 Aug 2022 16:54:47 +0000) 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:293378 Archived-At: > Date: Thu, 11 Aug 2022 16:54:47 +0000 > Cc: gregory@heytings.org, larsi@gnus.org, emacs-devel@gnu.org > From: Alan Mackenzie > > > We know that fontifications are incorrect, and where strings or > > comments start or end immediately, just after a single glance. We > > never need to go to BOB to find that out. > > Before the days of font-locking in editors, a standard problem was when a > comment didn't end where the user thought it did, for lack of a comment > ender. There was a particular problem in Pascal (whose precise details > aren't that important) where an unclosed comment on the THEN branch of an > IF statement would swallow up the ELSE branch completely, leaving no > visible trace or syntactic error. > > It's worth while being careful about strings and comments. As already mentioned up-thread, guessing without going far away could indeed guess wrong, but it is much cheaper and the probability of an error could be made small enough to be acceptable in cases where "being careful" means one has to wait for many seconds for a response for a simple editing command. The guesswork could be activated only when these situations arise, leaving the more accurate fontifications do their job in all the other cases.