emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposed extension of show-paren-mode: Highlight parens when point i


From: Eli Zaretskii
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

> Date: Sun, 12 Oct 2014 08:39:09 +0000
> Cc: address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]