From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Proposed extension of show-paren-mode: Highlight parens when point is in L or R margin. Date: Thu, 16 Oct 2014 13:31:37 +0000 Message-ID: <20141016133137.GE3421@acm.acm> References: <20141011134312.GA4148@acm.acm> <20141012100416.GC3148@acm.acm> <20141015091208.GA3093@acm.acm> <20141016095326.GC3421@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1413466672 26866 80.91.229.3 (16 Oct 2014 13:37:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2014 13:37:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 16 15:37:45 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 1XelFO-0002Bp-PI for ged-emacs-devel@m.gmane.org; Thu, 16 Oct 2014 15:37:42 +0200 Original-Received: from localhost ([::1]:50482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XelFO-0000G5-Cs for ged-emacs-devel@m.gmane.org; Thu, 16 Oct 2014 09:37:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XelFA-0000F5-BW for emacs-devel@gnu.org; Thu, 16 Oct 2014 09:37:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XelF2-0005c7-TR for emacs-devel@gnu.org; Thu, 16 Oct 2014 09:37:28 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:27325 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XelF2-0005c0-MR for emacs-devel@gnu.org; Thu, 16 Oct 2014 09:37:20 -0400 Original-Received: (qmail 2931 invoked by uid 3782); 16 Oct 2014 13:37:18 -0000 Original-Received: from acm.muc.de (pD9518029.dip0.t-ipconnect.de [217.81.128.41]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 16 Oct 2014 15:37:18 +0200 Original-Received: (qmail 4327 invoked by uid 1000); 16 Oct 2014 13:31:37 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x X-Received-From: 193.149.48.1 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:175455 Archived-At: Hello, Stefan. On Thu, Oct 16, 2014 at 08:59:40AM -0400, Stefan Monnier wrote: > > (defface show-paren-mismatch > > '((((class color)) (:foreground "white" :background "purple")) > > (t (:inverse-video t))) > > "Face used for a mismatching paren." > > :group 'paren-showing-faces) <-------- paren > > ^ > > | > > point > Ah, so now your periphery extends to the next line. No, no, no! By the two line arrow symbol, I meant point somewhere before ":group". > That means you get an ambiguity for .... Oh no I don't! > >> If so, I guess we should also do it in cases such as: > >> foo(blabla); > > Hmmm. Maybe. > OK, sounds good. There have already been requests for that kind of feature. OK. How about showing the paren (and its match) when (i) point is touching the paren, and is either outside it (current implementation), or inside it (new feature), with an "outside" taking prioirty; (ii) point is in the periphery and there is a paren at an extreme edge of the core, one at the nearest (to point) edge taking priority (already implemented)? > > But this whole idea was meant just to be a simple extension. > It's actually simpler to make it apply "everywhere" than only in a few > particular cases. [ ... ] > To tell you the truth, I didn't like much the last show-paren--default > you showed me. I'd kind of guessed that. > I think this new feature should be "completely" external and mostly > keep the old code untouched. OK, then. I'll extract a new defun paren-show--locate-near-paren which will return a cons (DIR . OLDPOS). I think that will satisfy you. Shouldn't take long, I'll send you a new patch soon. > Stefan -- Alan Mackenzie (Nuremberg, Germany).