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: Sun, 12 Oct 2014 10:18:46 +0000 Message-ID: <20141012101846.GD3148@acm.acm> References: <20141011134312.GA4148@acm.acm> <83vbnq8z6j.fsf@gnu.org> <20141012083908.GA3148@acm.acm> <837g058xvd.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1413109503 3182 80.91.229.3 (12 Oct 2014 10:25:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Oct 2014 10:25:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 12 12:24:56 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 1XdGKd-0005e4-8y for ged-emacs-devel@m.gmane.org; Sun, 12 Oct 2014 12:24:55 +0200 Original-Received: from localhost ([::1]:56783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdGKc-0004A7-Sz for ged-emacs-devel@m.gmane.org; Sun, 12 Oct 2014 06:24:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdGKN-0004A0-3M for emacs-devel@gnu.org; Sun, 12 Oct 2014 06:24:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XdGKC-0002Yd-Bc for emacs-devel@gnu.org; Sun, 12 Oct 2014 06:24:39 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:47190 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdGKC-0002YQ-21 for emacs-devel@gnu.org; Sun, 12 Oct 2014 06:24:28 -0400 Original-Received: (qmail 13676 invoked by uid 3782); 12 Oct 2014 10:24:26 -0000 Original-Received: from acm.muc.de (pD951B032.dip0.t-ipconnect.de [217.81.176.50]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 12 Oct 2014 12:24:25 +0200 Original-Received: (qmail 3614 invoked by uid 1000); 12 Oct 2014 10:18:46 -0000 Content-Disposition: inline In-Reply-To: <837g058xvd.fsf@gnu.org> 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:175286 Archived-At: Hi, Eli. On Sun, Oct 12, 2014 at 12:01:58PM +0300, Eli Zaretskii wrote: > > Date: Sun, 12 Oct 2014 08:39:09 +0000 > > Cc: emacs-devel@gnu.org > > From: Alan Mackenzie > > > Thanks, but PLEASE don't call this a "margin". [ ... ] I've now called it "periphery" and for that doc-string first line I've got: "If non-nil, show parens when point is in the line's periphery." [ ... ] > Now, let me ask something about the feature as designed (sorry, don't > have time right now to apply the patch and try this myself). Suppose > I have this line of C code: > FOO = xyz + foobar (a + (b * sqrt (c) - d) * e) - some; /* foo */ > Is the intent to have the parentheses of the call to 'foobar' > highlighted when point is before "FOO" or inside the comment, but > _not_ when point is between "xyz" and "foobar"? If so, this is soooo > weird! No. The only parens that get highlighted are ones at the beginning or end of the code on the line (together with their partners). > And what about this part of your description: > > So: If point is in the LH margin of the code, highlight the first paren > > on the line and its match, or failing that, the last paren on the line > > with its match. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > When would the "first paren and its match" fail? When the first non-whitespace character on the line isn't a paren. > Does this mean you are not going to look past the line with point, i.e. > multi-line parenthesized expressions will not be highlighted? They will be highlighted when one of the parens touches the line's periphery; it doesn't matter how far away the matching paren is, it will get highlighted. Anyhow, I've just blasted off an amended patch to Stefan. Maybe it's almost all right now. -- Alan Mackenzie (Nuremberg, Germany).