From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: CC Mode and electric-pair "problem". Date: Mon, 18 Jun 2018 23:52:57 -0400 Message-ID: <8f6c273f-9a20-0744-7f26-533aabb97a48@gmail.com> 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; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1529380296 1362 195.159.176.226 (19 Jun 2018 03:51:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2018 03:51:36 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 19 05:51: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 1fV7g3-0000H5-JQ for ged-emacs-devel@m.gmane.org; Tue, 19 Jun 2018 05:51:31 +0200 Original-Received: from localhost ([::1]:39261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV7iA-0001ET-Sa for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2018 23:53:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV7hU-0001EC-KW for emacs-devel@gnu.org; Mon, 18 Jun 2018 23:53:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fV7hT-00072E-IJ for emacs-devel@gnu.org; Mon, 18 Jun 2018 23:53:00 -0400 Original-Received: from mail-qt0-x22c.google.com ([2607:f8b0:400d:c0d::22c]:37092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fV7hT-000724-Cc for emacs-devel@gnu.org; Mon, 18 Jun 2018 23:52:59 -0400 Original-Received: by mail-qt0-x22c.google.com with SMTP id a18-v6so17228542qtj.4 for ; Mon, 18 Jun 2018 20:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=BC3XoRhD93th9GA1Jt+KwFBqc/PpqbqD9aqDsIyHveQ=; b=fXzyhaC5FVOsEzOMBbZrIO0BMOW1RbbO1KMUfoIZ8xn9SSQm+AkCRho3jSiHEldSgP rmitfLo1Wf1RMpR0C5b3Q6SACF7C9C1cQXdfsIQ/e3kD2k1qeInFbhoJoe3LtCS7LxLq pBPghAv+HWpU5ToTsXHl6kCPocpNu91/npG6Fcv46KtMJNHydwN/29GakWBbMO4QBp12 Ryxbj8U+kM36BzGHRAZ99bR5Hlor7L9p9msEqd7WxbT5VwJvAhB8eIVR4oI3OXPsd4ys pBpXNumtaKRp1yGlN2akP2jgPIeUg01dTENNae9usXYMpQb12SoIpW/4WjVUIYrbMC0l zZeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BC3XoRhD93th9GA1Jt+KwFBqc/PpqbqD9aqDsIyHveQ=; b=dbSVbtXRAzVIPTdsGYmjuX53zxab8Z2Ppd6nld/LbhpfyncaufathpzJNAK2CVd/ed 8aPeNEBYPWkH9eB4MHyd6upFpQLeWaQ1jF0efoylQrFv71exnug99fDshiD3nwQFI2fY Q6v68HovVc5J0uVJub301mJc2ceVSspFXndfJ4W8lUbpEoGK3kTDS4UPJlAzy4sbkAWQ z0ayp9ed7Qg7w70xHceiq5STgsmJF4lpgs6LEgGF/gJ8Dbr2OztYI/a3pu1vFC/0zJb/ huw9eG7E3qnkC4pRCprqj+2JfAoybEYntICBVm5SlHPWb280bv5odBt6GcXfkLoJRzHf h5iA== X-Gm-Message-State: APt69E2fIwDw9guJ0gmy1H33Eg1QSwnZA3M2N3FgBpMsrv9Eex+M0F9Q Vy7GJzbBV5TtiX15KD1CmpXgXjZZ X-Google-Smtp-Source: ADUXVKIe2KMBAUy1a9sIw61NWEcDyvf1GuxEdvrYfVOSvcsHehGDffdT8h/UgYgJUy3B1KuxhVUNyA== X-Received: by 2002:ac8:3fc4:: with SMTP id v4-v6mr13790588qtk.421.1529380378692; Mon, 18 Jun 2018 20:52:58 -0700 (PDT) Original-Received: from ?IPv6:2601:43:0:42c6:6d0f:480:6076:fc23? ([2601:43:0:42c6:6d0f:480:6076:fc23]) by smtp.gmail.com with ESMTPSA id w46-v6sm14031287qtw.55.2018.06.18.20.52.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 20:52:58 -0700 (PDT) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22c 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:226492 Archived-At: On 2018-06-18 21:48, Stefan Monnier wrote: > 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. Agreed. Given this criterion, the patch is an improvement: making sure that lines past the first one are not highlighted suppresses the risk of misleading the programmer into thinking that they have a multiline-string. (This happens to me from time to time in Python, actually: I write "abc def" instead of """abc def""", and the highlighting doesn't immediately reveal the error. Simply not highlighting the second line would help a lot. > 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. I'm not sure whether we can afford to bail out like that — for people who don't use some form of structured editing, most of the code that the IDE ends up seeing is broken in some way (unmatched { or ", incomplete declarations, incorrect numbers of arguments, undeclared identifiers, etc.) Modeling our error recovery behaviors on the one used by relevant compilers seems like a pretty good approach (ultimately, for the modes I maintain, I'd like to delegate fontification to a language server provided by the compiler).