From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: CC Mode and electric-pair "problem". Date: Mon, 18 Jun 2018 21:48:41 -0400 Message-ID: References: <20180531123747.GA24752@ACM> <20180617201351.GA4580@ACM> <20180618103654.GA9771@ACM> <20180618154227.GB3973@ACM> <20180618180846.GC3973@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529378676 25072 195.159.176.226 (19 Jun 2018 03:24:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2018 03:24:36 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 19 05:24:32 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 1fV7Fw-0006RA-6E for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2018 05:24:32 +0200 Original-Received: from localhost ([::1]:39060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV7I3-0006oQ-DE for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2018 23:26:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV5lW-0004YG-Dw for emacs-devel@gnu.org; Mon, 18 Jun 2018 21:49:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fV5lR-0001ho-It for emacs-devel@gnu.org; Mon, 18 Jun 2018 21:49:02 -0400 Original-Received: from [195.159.176.226] (port=35842 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fV5lR-0001he-Bj for emacs-devel@gnu.org; Mon, 18 Jun 2018 21:48:57 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fV5jD-0005QU-5l for emacs-devel@gnu.org; Tue, 19 Jun 2018 03:46:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:TQGTMoZpdzVglJGBm2jUi1MA748= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:226488 Archived-At: > char *foo = "foo; > int bar = 5; > char *baz = "baz"; > > The entire second line, and the third line, up to the first ", get string > face. We've been used to this for so long that we've lost sight of just > how bad and amateurish it really is. 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. Emacs can't reliably distinguish the two cases, so whichever behavior it chooses it will look "amateurish" in some cases. I think the better option here is to focus on the following: 1- Make sure the programmer is aware there's a problem in its code. I.e. highlight the opening quote or the non-escaped end-of-line or something in bright red or something like that. 2- Don't try to guess what the user intended to do. Instead keep our code as simple as possible: the C code we're handed is broken, so there's no real clear "right behavior" anyway. -- Stefan