From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs pretest -- electric-pair-mode change Date: Fri, 11 Apr 2014 15:58:40 -0400 Message-ID: References: <87d2h0ujls.fsf_-_@kitaj.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1397246374 27163 80.91.229.3 (11 Apr 2014 19:59:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2014 19:59:34 +0000 (UTC) Cc: Kevin Rodgers , emacs-devel@gnu.org To: joaotavora@gmail.com (=?windows-1252?B?Sm/jbyBU4XZvcmE=?=) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 11 21:59:26 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WYhbh-0002mY-D8 for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2014 21:59:25 +0200 Original-Received: from localhost ([::1]:59625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhbh-0000tM-2Y for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2014 15:59:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhbW-0000sy-MA for emacs-devel@gnu.org; Fri, 11 Apr 2014 15:59:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYhbO-0000q9-6m for emacs-devel@gnu.org; Fri, 11 Apr 2014 15:59:14 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:46525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhbO-0000px-0z for emacs-devel@gnu.org; Fri, 11 Apr 2014 15:59:06 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 423B784D8C; Fri, 11 Apr 2014 15:59:05 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id EA0A61E5B89; Fri, 11 Apr 2014 15:58:40 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id D13A3B4180; Fri, 11 Apr 2014 15:58:40 -0400 (EDT) In-Reply-To: (=?windows-1252?Q?=22Jo=E3o_T=E1v?= =?windows-1252?Q?ora=22's?= message of "Fri, 11 Apr 2014 19:23:36 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171406 Archived-At: > Re-reading Kevin's message I think there are two separate things here: > * deciding if the buffer is quote-balanced for pairing purposes. That > can indeed only be done according to your idea Stefan, i.e. finding a > safe spot the we assert to be outside a string. > * after having obtained reliable info that the buffer is unbalanced, we > can further decide if we want to surprise/disappoint the user. This > might be argued I think: if we know that there is an unbalance but > that it is outside the users view, decide to pair anyway. If it is in > the user's view, try to repair the unbalance by not pairing (this > second bit is what is already done) > I don't know if I personally would like it, perhaps it can be a > customization option. For strings, if we know that position POS, which should be outside of a string, is inside a string, we know that there's an imbalance. *But* we don't actually know where that imbalance comes from (it's just "somewhere before POS"), so we can't really tell if that imbalance is before or after window-end unless POS is itself before window-end. Stefan