From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii 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 12:01:58 +0300 Message-ID: <837g058xvd.fsf@gnu.org> References: <20141011134312.GA4148@acm.acm> <83vbnq8z6j.fsf@gnu.org> <20141012083908.GA3148@acm.acm> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1413104549 16207 80.91.229.3 (12 Oct 2014 09:02:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Oct 2014 09:02:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 12 11:02:22 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 1XdF2k-0000Qc-8p for ged-emacs-devel@m.gmane.org; Sun, 12 Oct 2014 11:02:22 +0200 Original-Received: from localhost ([::1]:56584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdF2j-0006l7-NO for ged-emacs-devel@m.gmane.org; Sun, 12 Oct 2014 05:02:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdF2c-0006ki-AF for emacs-devel@gnu.org; Sun, 12 Oct 2014 05:02:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XdF2X-0006TV-2T for emacs-devel@gnu.org; Sun, 12 Oct 2014 05:02:14 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:54872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdF2W-0006TK-ME for emacs-devel@gnu.org; Sun, 12 Oct 2014 05:02:09 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NDB00100PZWKT00@mtaout27.012.net.il> for emacs-devel@gnu.org; Sun, 12 Oct 2014 11:56:53 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NDB00H1PQ6T6XA0@mtaout27.012.net.il>; Sun, 12 Oct 2014 11:56:53 +0300 (IDT) In-reply-to: <20141012083908.GA3148@acm.acm> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.183 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:175283 Archived-At: > 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". > > OK, not "margin". But what, then? I tried for some time to come up > with something better that would still fit into a ~78 character first > line of the doc string for the new customisable variable. So far, I've > had this: > > "If non-nil, try to show parens when point is in LH or RH margin." This does not really fit into 78 characters, since LH and RH are entirely alien notions. I was about to suggest "If non-nil, highlight parens when point is inside the indentation." but that doesn't cover the "RH" part (which I personally find a weird feature, but that's me). > Maybe I could omit the "try to ". Definitely; it doesn't add anything. > How about something like: > > "If non-nil, show parens when point is before or after the line's code." Works for me. > As for the name "show-paren-when-point-in-margin", that would have to > become "show-parens-when-point-outside-code", or something, which isn't > quite accurate (sometimes, short comments are inside a line of code), > and isn't very nmonic. We don't need absolute accuracy if it requires too long names, IMO. > > We have already too many overloaded meanings of this term, so let's > > avoid adding yet another one. > > Hmm. Or, perhaps we could just admit this, and allow "margin" to be > used loosely whenever appropriate. ;-). No, please let's not. 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! 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? Does this mean you are not going to look past the line with point, i.e. multi-line parenthesized expressions will not be highlighted?