From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Fontifying unterminated strings [was: CC Mode and electric-pair "problem".] Date: Tue, 26 Jun 2018 21:02:54 +0100 Message-ID: <87woull3ip.fsf@gmail.com> References: <20180531123747.GA24752@ACM> <20180617201351.GA4580@ACM> <20180618103654.GA9771@ACM> <20180618154227.GB3973@ACM> <20180618180846.GC3973@ACM> <20180626160850.GA4464@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530043310 29275 195.159.176.226 (26 Jun 2018 20:01:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Jun 2018 20:01:50 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel , Stefan Monnier , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 26 22:01:46 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXu9q-0007V6-77 for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2018 22:01:46 +0200 Original-Received: from localhost ([::1]:55122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXuBx-0004MK-Kj for ged-emacs-devel@m.gmane.org; Tue, 26 Jun 2018 16:03:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXuB9-0004MB-Lb for emacs-devel@gnu.org; Tue, 26 Jun 2018 16:03:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXuB4-0005pN-4Y for emacs-devel@gnu.org; Tue, 26 Jun 2018 16:03:07 -0400 Original-Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:38370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXuB3-0005pA-TM for emacs-devel@gnu.org; Tue, 26 Jun 2018 16:03:02 -0400 Original-Received: by mail-wm0-x22f.google.com with SMTP id 69-v6so3069645wmf.3 for ; Tue, 26 Jun 2018 13:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=kOcx92Mz6v3uIxKrPf/RrCrLaDKwqocDZuUe/VF50Ck=; b=l8/AA21nmF5YlZI1MpGruFXM0AvgipizQqfIVI6CC+C05B8Ac/yw2RIONAQaqLVYrL Rlu2034WIqqKlpmxBwL2mzIuiJ4JJk2OHgzs/LL4HoMczDOwSGV/EvgjydKWm0YZjRqD u2J/RtZRQwGbmGXbEffoVJyCfBNtaVLgAgV4OZoScLy2YvhbCMG4rihiRnXFsAEYjOP1 3R9aAllt68eKGB2IDEMeR5dKhrt9s4FWC/x+zzXpGD7C5EGJ9FWU1AT5kK+xiaSfRgSE zkN6plSjKN8Sw3Si5WQ5qp5Cqw5s5xmex/TGPj4Yf3AyswWpbj1aY1DSJi9Gky6nIPAA ai0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=kOcx92Mz6v3uIxKrPf/RrCrLaDKwqocDZuUe/VF50Ck=; b=VRnc2Z0g6DNKi+UEuKz7to6IaEqoWjIaiDbhacdnj9kBnup3Xz6GLgpMWUKY+nMS4v RSPro2P0rlPT379kAMGfwEW4bWCAUGISW1jO7lRI1c391YtCjLpTZIuRDr6MaB2QexlG BWIdDAIHlhlAlvBSuuZsEIh37QQ4NXvssRZSyUqRCQcJ9UNb0gpyatEYym67CGtnKzHu VXwodBOMSAOJtskqYts0x74HXpOi2ig0gdMs2K97LSc3blNMANunWdFSdMPrUuuAnWU0 h8Kqo8L83Q/DwAhivBKfr72zIXzBH+Z6Jw1xWl0+OEuf0mwSirjwvBTcLmZihbI7qKjD j64g== X-Gm-Message-State: APt69E21RBsYU93qfo+oISUJGPgXZ1ROHkoCjeKD77SqUluvqulLwcXq EqK4xmrDKDVU1zFCfDNoprE= X-Google-Smtp-Source: AAOMgpeNzZWEwINADdcPUfKaFZ4rrmqFQ3UnEjgRQkjllV2zvcoOrTbDSTZDNNJe6LiYth9B1YhCQw== X-Received: by 2002:a1c:58d1:: with SMTP id m200-v6mr2839236wmb.160.1530043380760; Tue, 26 Jun 2018 13:03:00 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id y8-v6sm3856445wrq.35.2018.06.26.13.02.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 13:03:00 -0700 (PDT) In-Reply-To: <20180626160850.GA4464@ACM> (Alan Mackenzie's message of "Tue, 26 Jun 2018 16:08:50 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226751 Archived-At: Alan Mackenzie writes: >> But what about when you write >> char *thedoc = "Here it is: >> - First do this >> - Then do that >> And that's it!"; >> Both cases are valid transient states. Which one will occur more often >> depends a lot on the particular kind of code you write and your >> coding habits. > I suggest the most common case by far will be writing > char *foo = "foo.... > in the middle of an existing buffer. You can't know that, really. It's not just the users of electric-pair-mode, but users of other popular autopairing packages, or those autopair manually. Or users who mostly edit existing code. One could even speculate (just as tremulously) that more C code gets maintained than written these days. >> Emacs can't reliably distinguish the two cases, so whichever behavior it >> chooses it will look "amateurish" in some cases. > No, you've misunderstood my point. It is not the aesthetic "niceness", > the lack of which is amateurish; it is fontifying as a string something > which isn't a string (as defined by the compiler's error messages). It is just as wrong as fontifying something as C statements that isn't a C statement.