unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39360: Add :extend attribute to show-paren-mode expression face
@ 2020-01-30 21:08 Clément Pit-Claudel
  2020-01-30 23:35 ` Dmitry Gutov
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Clément Pit-Claudel @ 2020-01-30 21:08 UTC (permalink / raw)
  To: 39360

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

Hi all,

I've attached a patch to add :extend the show-paren-mode face applied to expressions.  Is that the right way to return to the previous behavior?
I might have missed discussions about this; is there a reason why :extend t isn't the default?

Clément.

[-- Attachment #2: 0001-Add-extend-face-property-to-show-paren-match-express.patch --]
[-- Type: text/x-patch, Size: 875 bytes --]

From 7f7221e35d48755c814e4ee3b08c298a8717d883 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Pit-Claudel?= <clement.pitclaudel@live.com>
Date: Thu, 30 Jan 2020 16:02:02 -0500
Subject: [PATCH] Add :extend face property to show-paren-match-expression

* lisp/faces.el (show-paren-match-expression): Add :extend attribute.
---
 lisp/faces.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/faces.el b/lisp/faces.el
index 9a49ea8104..6a4cf2a2a2 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2841,7 +2841,7 @@ show-paren-match
   :group 'paren-showing-faces)
 
 (defface show-paren-match-expression
-  '((t :inherit show-paren-match))
+  '((t :inherit show-paren-match :extend t))
   "Face used for a matching paren when highlighting the whole expression.
 This face is used by `show-paren-mode'."
   :group 'paren-showing-faces
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-30 21:08 bug#39360: Add :extend attribute to show-paren-mode expression face Clément Pit-Claudel
@ 2020-01-30 23:35 ` Dmitry Gutov
  2020-01-31  7:38 ` Eli Zaretskii
  2020-09-20 10:01 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 26+ messages in thread
From: Dmitry Gutov @ 2020-01-30 23:35 UTC (permalink / raw)
  To: Clément Pit-Claudel, 39360

Hi!

On 31.01.2020 0:08, Clément Pit-Claudel wrote:

> I've attached a patch to add :extend the show-paren-mode face applied to expressions.  Is that the right way to return to the previous behavior?

Yes. And I think it's a good choice for this face, going by analogy with 
the region face.

> I might have missed discussions about this; is there a reason why :extend t isn't the default?

Because we'd have had to disable it on too many faces... I think. Maybe 
Eli has a different answer.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-30 21:08 bug#39360: Add :extend attribute to show-paren-mode expression face Clément Pit-Claudel
  2020-01-30 23:35 ` Dmitry Gutov
@ 2020-01-31  7:38 ` Eli Zaretskii
  2020-01-31 14:52   ` Clément Pit-Claudel
  2020-09-20 10:01 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31  7:38 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 39360

> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Thu, 30 Jan 2020 16:08:50 -0500
> 
> I've attached a patch to add :extend the show-paren-mode face applied to expressions.  Is that the right way to return to the previous behavior?

Thanks.

Please describe a use case where this problem shows up, I'm not sure I
understand it completely.  More accurately, I don't think I understand
why you think we must have the previous behavior with this face,
i.e. why the new behavior is "wrong".

> I might have missed discussions about this; is there a reason why :extend t isn't the default?

Because the whole idea of introducing :extend was that almost all
faces don't need this attribute.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31  7:38 ` Eli Zaretskii
@ 2020-01-31 14:52   ` Clément Pit-Claudel
  2020-01-31 15:32     ` Eli Zaretskii
                       ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Clément Pit-Claudel @ 2020-01-31 14:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39360

On 2020-01-31 02:38, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Thu, 30 Jan 2020 16:08:50 -0500
>>
>> I've attached a patch to add :extend the show-paren-mode face applied to expressions.  Is that the right way to return to the previous behavior?
> 
> Thanks.
> 
> Please describe a use case where this problem shows up, I'm not sure I
> understand it completely.  More accurately, I don't think I understand
> why you think we must have the previous behavior with this face,
> i.e. why the new behavior is "wrong".

Unless people were complaining about the old behavior for this particular face, I think that behavior was fine.
More to the point, though, since the newline is inside the parentheses, it makes sense to me to extend the highlight continuously up to the edge of the window.

>> I might have missed discussions about this; is there a reason why :extend t isn't the default?
> 
> Because the whole idea of introducing :extend was that almost all
> faces don't need this attribute.

I see.  The new default looks weird to me, but I'm sure I'll get used to it.  Is there a reason to highlight one blank space at the end of each line, though, instead of only highlighting the text?

Clément.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 14:52   ` Clément Pit-Claudel
@ 2020-01-31 15:32     ` Eli Zaretskii
  2020-01-31 15:51       ` Clément Pit-Claudel
  2020-01-31 15:44     ` martin rudalics
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 15:32 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 39360

> Cc: 39360@debbugs.gnu.org
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Fri, 31 Jan 2020 09:52:25 -0500
> 
> > Please describe a use case where this problem shows up, I'm not sure I
> > understand it completely.  More accurately, I don't think I understand
> > why you think we must have the previous behavior with this face,
> > i.e. why the new behavior is "wrong".
> 
> Unless people were complaining about the old behavior for this particular face, I think that behavior was fine.

IMO it was not fine, because Emacs was behaving differently from every
other application out there which supports some form of highlighting
text that spans several lines.  The old behavior was also inconsistent
between different face attributes: background color behaved
differently from underline, for example, and GUI frames behaved
differently from TTY frames.

> More to the point, though, since the newline is inside the parentheses, it makes sense to me to extend the highlight continuously up to the edge of the window.

The newline is inside the parentheses, but the empty space to the
right of the newline is not part of the text.  Why should it be
highlighted?

> >> I might have missed discussions about this; is there a reason why :extend t isn't the default?
> > 
> > Because the whole idea of introducing :extend was that almost all
> > faces don't need this attribute.
> 
> I see.  The new default looks weird to me, but I'm sure I'll get used to it.

The question I'd like to ask is whether you'll get used to it wrt the
show-paren-mode face.

> Is there a reason to highlight one blank space at the end of each line, though, instead of only highlighting the text?

That blank space stands for the newline, so if the newline has that
face, the space glyph at EOL gets highlighted to indicate that fact.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 14:52   ` Clément Pit-Claudel
  2020-01-31 15:32     ` Eli Zaretskii
@ 2020-01-31 15:44     ` martin rudalics
  2020-01-31 15:55       ` Eli Zaretskii
  2020-01-31 16:03     ` Stephen Berman
  2020-01-31 16:07     ` Stephen Berman
  3 siblings, 1 reply; 26+ messages in thread
From: martin rudalics @ 2020-01-31 15:44 UTC (permalink / raw)
  To: Clément Pit-Claudel, Eli Zaretskii; +Cc: 39360

 > Is there a reason to highlight one blank space at the end of each line, though, instead of only highlighting the text?

It continues to irritate me as well.  Maybe an option to turn it off?

martin





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 15:32     ` Eli Zaretskii
@ 2020-01-31 15:51       ` Clément Pit-Claudel
  2020-01-31 17:03         ` Eli Zaretskii
  0 siblings, 1 reply; 26+ messages in thread
From: Clément Pit-Claudel @ 2020-01-31 15:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39360

On 2020-01-31 10:32, Eli Zaretskii wrote:
>> Unless people were complaining about the old behavior for this
>> particular face, I think that behavior was fine.

> IMO it was not fine, because Emacs was behaving differently from
> every other application out there which supports some form of
> highlighting text that spans several lines.

OK, good point, I never paid attention to that.

> The newline is inside the parentheses, but the empty space to the 
> right of the newline is not part of the text.  Why should it be 
> highlighted?

For the same reason that the region highlight goes to the edge of the window, I think.

>> Is there a reason to highlight one blank space at the end of each
>> line, though, instead of only highlighting the text?
> 
> That blank space stands for the newline, so if the newline has that 
> face, the space glyph at EOL gets highlighted to indicate that fact.

I see; I would expect that space to be visible only in whitespace-mode (in fact, when enabling whitespace-mode, there's now a character to indicate the line ending and a highlighted whitespace next to it)





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 15:44     ` martin rudalics
@ 2020-01-31 15:55       ` Eli Zaretskii
  2020-01-31 16:12         ` Clément Pit-Claudel
  2020-01-31 16:45         ` martin rudalics
  0 siblings, 2 replies; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 15:55 UTC (permalink / raw)
  To: martin rudalics; +Cc: cpitclaudel, 39360

> Cc: 39360@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
> Date: Fri, 31 Jan 2020 16:44:27 +0100
> 
>  > Is there a reason to highlight one blank space at the end of each line, though, instead of only highlighting the text?
> 
> It continues to irritate me as well.  Maybe an option to turn it off?

IMO, it's too early to discuss such an option: we don't yet know how
this feature will end up in Emacs 27 and beyond, because we didn't yet
have enough user feedback.  What we have now is similar to how other
programs behave, including highlighting of the space beyond EOL.  Does
it irritate you in those other programs as well?





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 14:52   ` Clément Pit-Claudel
  2020-01-31 15:32     ` Eli Zaretskii
  2020-01-31 15:44     ` martin rudalics
@ 2020-01-31 16:03     ` Stephen Berman
  2020-01-31 16:45       ` martin rudalics
  2020-01-31 17:07       ` Eli Zaretskii
  2020-01-31 16:07     ` Stephen Berman
  3 siblings, 2 replies; 26+ messages in thread
From: Stephen Berman @ 2020-01-31 16:03 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 39360

[-- Attachment #1: Type: text/plain, Size: 974 bytes --]

On Fri, 31 Jan 2020 09:52:25 -0500 Clément Pit-Claudel <cpitclaudel@gmail.com> wrote:

> On 2020-01-31 02:38, Eli Zaretskii wrote:
>>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>>> Date: Thu, 30 Jan 2020 16:08:50 -0500
[...]
>>> I might have missed discussions about this; is there a reason why :extend t
>>> isn't the default?
>> 
>> Because the whole idea of introducing :extend was that almost all
>> faces don't need this attribute.
>
> I see.  The new default looks weird to me, but I'm sure I'll get used to it.

What also looks weird and infelicitous to me is that a nonextending
background color face on multiple lines shows up on the empty space at
the beginning of a line, i.e., it appears to extend into this space, see
attached screenshot.  I think this only happens with white space
characters, not with lines indented e.g. with wrap-prefix.  It would be
nice to treat all "empty" space the same in this respect.

Steve Berman


[-- Attachment #2: show-paren.png --]
[-- Type: image/png, Size: 22170 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 14:52   ` Clément Pit-Claudel
                       ` (2 preceding siblings ...)
  2020-01-31 16:03     ` Stephen Berman
@ 2020-01-31 16:07     ` Stephen Berman
  3 siblings, 0 replies; 26+ messages in thread
From: Stephen Berman @ 2020-01-31 16:07 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 39360

[-- Attachment #1: Type: text/plain, Size: 974 bytes --]

On Fri, 31 Jan 2020 09:52:25 -0500 Clément Pit-Claudel <cpitclaudel@gmail.com> wrote:

> On 2020-01-31 02:38, Eli Zaretskii wrote:
>>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>>> Date: Thu, 30 Jan 2020 16:08:50 -0500
[...]
>>> I might have missed discussions about this; is there a reason why :extend t
>>> isn't the default?
>> 
>> Because the whole idea of introducing :extend was that almost all
>> faces don't need this attribute.
>
> I see.  The new default looks weird to me, but I'm sure I'll get used to it.

What also looks weird and infelicitous to me is that a nonextending
background color face on multiple lines shows up on the empty space at
the beginning of a line, i.e., it appears to extend into this space, see
attached screenshot.  I think this only happens with white space
characters, not with lines indented e.g. with wrap-prefix.  It would be
nice to treat all "empty" space the same in this respect.

Steve Berman


[-- Attachment #2: show-paren.png --]
[-- Type: image/png, Size: 22170 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 15:55       ` Eli Zaretskii
@ 2020-01-31 16:12         ` Clément Pit-Claudel
  2020-01-31 17:12           ` Eli Zaretskii
  2020-01-31 16:45         ` martin rudalics
  1 sibling, 1 reply; 26+ messages in thread
From: Clément Pit-Claudel @ 2020-01-31 16:12 UTC (permalink / raw)
  To: Eli Zaretskii, martin rudalics; +Cc: 39360

On 2020-01-31 10:55, Eli Zaretskii wrote:
> What we have now is similar to how other
> programs behave, including highlighting of the space beyond EOL.  Does
> it irritate you in those other programs as well?

On my machine at least, none of vim, nano, or thunderbird highlights the EOL space.  

Firefox does highlight the end-of-line space on line wraps, but not when the newline is due to a paragraph change or an explicit <br /> in the source. LibreOffice and gedit highlight past the end of the line, stretching to the end of the window like Emacs does for the region.

If I highlight a region in LibreOffice using the highlighter tool to apply a background color, that color extends over one space to the right of the text when there's a line wrap (because the space over which the line is broken is before the break), but explicit newlines are not highlighted.

I couldn't find a program on my machine that behave like Emacs now does (highlighting explicit newlines).

Clément.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 15:55       ` Eli Zaretskii
  2020-01-31 16:12         ` Clément Pit-Claudel
@ 2020-01-31 16:45         ` martin rudalics
  1 sibling, 0 replies; 26+ messages in thread
From: martin rudalics @ 2020-01-31 16:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cpitclaudel, 39360

 > IMO, it's too early to discuss such an option: we don't yet know how
 > this feature will end up in Emacs 27 and beyond, because we didn't yet
 > have enough user feedback.  What we have now is similar to how other
 > programs behave, including highlighting of the space beyond EOL.  Does
 > it irritate you in those other programs as well?

I've never seen another program highlighting the newline character the
way we do now.

martin





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 16:03     ` Stephen Berman
@ 2020-01-31 16:45       ` martin rudalics
  2020-01-31 17:15         ` Eli Zaretskii
  2020-01-31 17:07       ` Eli Zaretskii
  1 sibling, 1 reply; 26+ messages in thread
From: martin rudalics @ 2020-01-31 16:45 UTC (permalink / raw)
  To: Stephen Berman, Clément Pit-Claudel; +Cc: 39360

 > What also looks weird and infelicitous to me is that a nonextending
 > background color face on multiple lines shows up on the empty space at
 > the beginning of a line, i.e., it appears to extend into this space, see
 > attached screenshot.  I think this only happens with white space
 > characters, not with lines indented e.g. with wrap-prefix.  It would be
 > nice to treat all "empty" space the same in this respect.

It would be nice to have that.  But I doubt that it can be done.

martin





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 15:51       ` Clément Pit-Claudel
@ 2020-01-31 17:03         ` Eli Zaretskii
  2020-02-07  0:27           ` Dmitry Gutov
  0 siblings, 1 reply; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 17:03 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 39360

> Cc: 39360@debbugs.gnu.org
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Fri, 31 Jan 2020 10:51:08 -0500
> 
> > The newline is inside the parentheses, but the empty space to the 
> > right of the newline is not part of the text.  Why should it be 
> > highlighted?
> 
> For the same reason that the region highlight goes to the edge of the window, I think.

We left the region as it was to avoid too strong outcry.  In general,
region should also not extend, IMO.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 16:03     ` Stephen Berman
  2020-01-31 16:45       ` martin rudalics
@ 2020-01-31 17:07       ` Eli Zaretskii
  1 sibling, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 17:07 UTC (permalink / raw)
  To: Stephen Berman; +Cc: cpitclaudel, 39360

> From: Stephen Berman <stephen.berman@gmx.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  39360@debbugs.gnu.org
> Date: Fri, 31 Jan 2020 17:03:41 +0100
> 
> What also looks weird and infelicitous to me is that a nonextending
> background color face on multiple lines shows up on the empty space at
> the beginning of a line, i.e., it appears to extend into this space, see
> attached screenshot.  I think this only happens with white space
> characters, not with lines indented e.g. with wrap-prefix.  It would be
> nice to treat all "empty" space the same in this respect.

That space is not empty, there are characters there.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 16:12         ` Clément Pit-Claudel
@ 2020-01-31 17:12           ` Eli Zaretskii
  2020-01-31 17:19             ` Dmitry Gutov
  2020-01-31 17:22             ` Eli Zaretskii
  0 siblings, 2 replies; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 17:12 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 39360

> Cc: 39360@debbugs.gnu.org
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Fri, 31 Jan 2020 11:12:37 -0500
> 
> I couldn't find a program on my machine that behave like Emacs now does (highlighting explicit newlines).

MS Office does.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 16:45       ` martin rudalics
@ 2020-01-31 17:15         ` Eli Zaretskii
  0 siblings, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 17:15 UTC (permalink / raw)
  To: martin rudalics; +Cc: cpitclaudel, stephen.berman, 39360

> From: martin rudalics <rudalics@gmx.at>
> Date: Fri, 31 Jan 2020 17:45:39 +0100
> Cc: 39360@debbugs.gnu.org
> 
>  > What also looks weird and infelicitous to me is that a nonextending
>  > background color face on multiple lines shows up on the empty space at
>  > the beginning of a line, i.e., it appears to extend into this space, see
>  > attached screenshot.  I think this only happens with white space
>  > characters, not with lines indented e.g. with wrap-prefix.  It would be
>  > nice to treat all "empty" space the same in this respect.
> 
> It would be nice to have that.  But I doubt that it can be done.

It can be done, it just isn't trivial.  The implementation could be
similar to trailing-whitespace (which isn't trivial, either).

But again, I'm not sure we should discuss these changes so soon.  The
face-extension feature is not out of the woods yet, IMO.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 17:12           ` Eli Zaretskii
@ 2020-01-31 17:19             ` Dmitry Gutov
  2020-01-31 19:19               ` Eli Zaretskii
  2020-01-31 17:22             ` Eli Zaretskii
  1 sibling, 1 reply; 26+ messages in thread
From: Dmitry Gutov @ 2020-01-31 17:19 UTC (permalink / raw)
  To: Eli Zaretskii, Clément Pit-Claudel; +Cc: 39360

On 31.01.2020 20:12, Eli Zaretskii wrote:
> MS Office does

Does it highlight just one space at the end of a line?

I just tried LibreOffice Writer, and it highlights the lines until the 
end of the "window", like like Emacs has been doing for decades.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 17:12           ` Eli Zaretskii
  2020-01-31 17:19             ` Dmitry Gutov
@ 2020-01-31 17:22             ` Eli Zaretskii
  2020-02-01 20:54               ` Clément Pit-Claudel
  1 sibling, 1 reply; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 17:22 UTC (permalink / raw)
  To: cpitclaudel; +Cc: 39360

> Date: Fri, 31 Jan 2020 19:12:19 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 39360@debbugs.gnu.org
> 
> > Cc: 39360@debbugs.gnu.org
> > From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> > Date: Fri, 31 Jan 2020 11:12:37 -0500
> > 
> > I couldn't find a program on my machine that behave like Emacs now does (highlighting explicit newlines).
> 
> MS Office does.

Also, most text buffers in Emacs have explicit newlines at the end of
each line, so highlighting them is more like LibreOffice and Firefox
do.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 17:19             ` Dmitry Gutov
@ 2020-01-31 19:19               ` Eli Zaretskii
  0 siblings, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2020-01-31 19:19 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: cpitclaudel, 39360

> Cc: 39360@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Fri, 31 Jan 2020 20:19:52 +0300
> 
> On 31.01.2020 20:12, Eli Zaretskii wrote:
> > MS Office does
> 
> Does it highlight just one space at the end of a line?

Yes.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 17:22             ` Eli Zaretskii
@ 2020-02-01 20:54               ` Clément Pit-Claudel
  0 siblings, 0 replies; 26+ messages in thread
From: Clément Pit-Claudel @ 2020-02-01 20:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39360

On 2020-01-31 12:22, Eli Zaretskii wrote:
>> Date: Fri, 31 Jan 2020 19:12:19 +0200
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: 39360@debbugs.gnu.org
>>
>>> Cc: 39360@debbugs.gnu.org
>>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>>> Date: Fri, 31 Jan 2020 11:12:37 -0500
>>>
>>> I couldn't find a program on my machine that behave like Emacs now does (highlighting explicit newlines).
>>
>> MS Office does.
> 
> Also, most text buffers in Emacs have explicit newlines at the end of
> each line, so highlighting them is more like LibreOffice and Firefox
> do.

As far as I can tell, Firefox highlights a space at the end of the line only if there is an actual space (ascii 32), but not if there's an explicit newline.  In other words, it highlights over continuation lines, but not over explicit newlines.

That is to say, we highlight this (with show-paren-mode and visual-line-mode, assuming the line is too long to fit in the window):

(test test test test test test test test test test test test test test test test test test test test test test test test test)

the same way as this:

(test test test test test test test test test test test test test test test
test test test test test test test test test test)

Whereas firefox highlights the end-of-line blank only in the first case, right where the line wraps.

Clément.






^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-31 17:03         ` Eli Zaretskii
@ 2020-02-07  0:27           ` Dmitry Gutov
  2020-02-07  0:40             ` Juri Linkov
  2020-02-07  8:02             ` Eli Zaretskii
  0 siblings, 2 replies; 26+ messages in thread
From: Dmitry Gutov @ 2020-02-07  0:27 UTC (permalink / raw)
  To: Eli Zaretskii, Clément Pit-Claudel; +Cc: 39360

On 31.01.2020 20:03, Eli Zaretskii wrote:
>>> The newline is inside the parentheses, but the empty space to the
>>> right of the newline is not part of the text.  Why should it be
>>> highlighted?
>> For the same reason that the region highlight goes to the edge of the window, I think.
> We left the region as it was to avoid too strong outcry.  In general,
> region should also not extend, IMO.

How about the reasons of consistency?

I'd be fine if region was not extended. But since we do extend it, why 
not make other face defaults in similar situations consistent with that?





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-02-07  0:27           ` Dmitry Gutov
@ 2020-02-07  0:40             ` Juri Linkov
  2020-02-07  8:13               ` Eli Zaretskii
  2020-02-07  8:02             ` Eli Zaretskii
  1 sibling, 1 reply; 26+ messages in thread
From: Juri Linkov @ 2020-02-07  0:40 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Clément Pit-Claudel, 39360

>>>> The newline is inside the parentheses, but the empty space to the
>>>> right of the newline is not part of the text.  Why should it be
>>>> highlighted?
>>> For the same reason that the region highlight goes to the edge of the window, I think.
>> We left the region as it was to avoid too strong outcry.  In general,
>> region should also not extend, IMO.
>
> How about the reasons of consistency?
>
> I'd be fine if region was not extended. But since we do extend it, why not
> make other face defaults in similar situations consistent with that?

There are not too many faces that could be extended for the same
reason why the region face is extended.  From all faces that I used
only a few required customizing to add :extend t, namely:

mm-uu-extract
org-block
org-block-begin-line
xref-file-header (because I customized it to have a grey background color
                  like in diff-mode)





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-02-07  0:27           ` Dmitry Gutov
  2020-02-07  0:40             ` Juri Linkov
@ 2020-02-07  8:02             ` Eli Zaretskii
  1 sibling, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2020-02-07  8:02 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: cpitclaudel, 39360

> Cc: 39360@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Fri, 7 Feb 2020 03:27:15 +0300
> 
> > We left the region as it was to avoid too strong outcry.  In general,
> > region should also not extend, IMO.
> 
> How about the reasons of consistency?

It takes a back seat in this case.  (And in general, consistency is a
very weak argument in this case, because each face is used in
different circumstances.)

> I'd be fine if region was not extended. But since we do extend it, why 
> not make other face defaults in similar situations consistent with that?

Because, as explained previously, the fact that region extends is a
kind-of "retreat".  Doing that for many other faces would mean the
feature itself is useless, and probably should not have been coded in
the first place.  I don't think this is the case.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-02-07  0:40             ` Juri Linkov
@ 2020-02-07  8:13               ` Eli Zaretskii
  0 siblings, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2020-02-07  8:13 UTC (permalink / raw)
  To: Juri Linkov; +Cc: cpitclaudel, 39360, dgutov

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Clément Pit-Claudel
>  <cpitclaudel@gmail.com>,  39360@debbugs.gnu.org
> Date: Fri, 07 Feb 2020 02:40:17 +0200
> 
> There are not too many faces that could be extended for the same
> reason why the region face is extended.  From all faces that I used
> only a few required customizing to add :extend t, namely:
> 
> mm-uu-extract
> org-block
> org-block-begin-line

These are up to the developers of the corresponding packages.
Although IMNSHO, the last one doesn't sound to me like a face that
should be extended by default.

> xref-file-header (because I customized it to have a grey background color
>                   like in diff-mode)

If you customize that face, you could also make it extend while at
that, no?  IOW, what you say doesn't sound like an argument for making
it extend by default, since by default it specifies only the
foreground color and the weight.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#39360: Add :extend attribute to show-paren-mode expression face
  2020-01-30 21:08 bug#39360: Add :extend attribute to show-paren-mode expression face Clément Pit-Claudel
  2020-01-30 23:35 ` Dmitry Gutov
  2020-01-31  7:38 ` Eli Zaretskii
@ 2020-09-20 10:01 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 26+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-20 10:01 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: 39360

Clément Pit-Claudel <cpitclaudel@gmail.com> writes:

> I've attached a patch to add :extend the show-paren-mode face applied
> to expressions.  Is that the right way to return to the previous
> behavior?

[...]

>  (defface show-paren-match-expression
> -  '((t :inherit show-paren-match))
> +  '((t :inherit show-paren-match :extend t))

After playing with this a bit, I think the current behaviour looks
slightly more logical -- it'd be even better if show-paren-mode didn't
highlight the blank space at the start of the line, either, but
highlighting to the end of the line looks pretty overwhelming.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2020-09-20 10:01 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-30 21:08 bug#39360: Add :extend attribute to show-paren-mode expression face Clément Pit-Claudel
2020-01-30 23:35 ` Dmitry Gutov
2020-01-31  7:38 ` Eli Zaretskii
2020-01-31 14:52   ` Clément Pit-Claudel
2020-01-31 15:32     ` Eli Zaretskii
2020-01-31 15:51       ` Clément Pit-Claudel
2020-01-31 17:03         ` Eli Zaretskii
2020-02-07  0:27           ` Dmitry Gutov
2020-02-07  0:40             ` Juri Linkov
2020-02-07  8:13               ` Eli Zaretskii
2020-02-07  8:02             ` Eli Zaretskii
2020-01-31 15:44     ` martin rudalics
2020-01-31 15:55       ` Eli Zaretskii
2020-01-31 16:12         ` Clément Pit-Claudel
2020-01-31 17:12           ` Eli Zaretskii
2020-01-31 17:19             ` Dmitry Gutov
2020-01-31 19:19               ` Eli Zaretskii
2020-01-31 17:22             ` Eli Zaretskii
2020-02-01 20:54               ` Clément Pit-Claudel
2020-01-31 16:45         ` martin rudalics
2020-01-31 16:03     ` Stephen Berman
2020-01-31 16:45       ` martin rudalics
2020-01-31 17:15         ` Eli Zaretskii
2020-01-31 17:07       ` Eli Zaretskii
2020-01-31 16:07     ` Stephen Berman
2020-09-20 10:01 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).