all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How can I make hl-line mode not override the color of rainbow-mode?
@ 2017-10-26 16:27 Amos Bird
  2017-10-26 21:54 ` Emanuel Berg
  2017-10-26 23:10 ` Drew Adams
  0 siblings, 2 replies; 11+ messages in thread
From: Amos Bird @ 2017-10-26 16:27 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

How can I make hl-line mode not override the color of 
rainbow-mode?

https://i.stack.imgur.com/fh11k.png

Is there an non-intrusive way to do this?

regards,


--
Amos Bird
amosbird@gmail.com



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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-26 16:27 How can I make hl-line mode not override the color of rainbow-mode? Amos Bird
@ 2017-10-26 21:54 ` Emanuel Berg
  2017-10-26 23:10 ` Drew Adams
  1 sibling, 0 replies; 11+ messages in thread
From: Emanuel Berg @ 2017-10-26 21:54 UTC (permalink / raw)
  To: help-gnu-emacs

Amos Bird wrote:

> How can I make hl-line mode not override the
> color of rainbow-mode?
>
> https://i.stack.imgur.com/fh11k.png

Interesting question! I just checked out the
code for hl-line and it is nothing less than
*gorgeous*!

Who wrote it?! Oh wait, it says so: Dave Love,
way back in 1998.

Drop him a mail and maybe he'll know a way even
tho I don't know how widespread the combination
hl-line and rainbow-mode is :)

-- 
underground experts united
http://user.it.uu.se/~embe8573




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

* RE: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-26 16:27 How can I make hl-line mode not override the color of rainbow-mode? Amos Bird
  2017-10-26 21:54 ` Emanuel Berg
@ 2017-10-26 23:10 ` Drew Adams
  2017-10-27  2:15   ` Amos Bird
  1 sibling, 1 reply; 11+ messages in thread
From: Drew Adams @ 2017-10-26 23:10 UTC (permalink / raw)
  To: Amos Bird, help-gnu-emacs

> How can I make hl-line mode not override the color of
> rainbow-mode?
> 
> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__i.stack.imgur.com_fh11k.png&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5Y
> TpkKY057SbK10&r=qZLZosY6GBAaJtOG9v8QX7nD4BS9t9s5otgxC3d4IFU&m=0cysGUafKkn
> 05ieu20oYLMZxbhi3LmzWz2B2DcaeCgY&s=IUgAkHZTo4jnGih15NlP4kUZj-kXymJcX-
> KgBbBlIbA&e=
> 
> Is there an non-intrusive way to do this?

https://emacs.stackexchange.com/a/23965/105

`rainbow-mode' uses text properties to highlight.
`hl-line-mode' uses an overlay to highlight.
Overlay highlighting overrides text-property highlighting.



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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-26 23:10 ` Drew Adams
@ 2017-10-27  2:15   ` Amos Bird
  2017-10-27  2:24     ` Emanuel Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Amos Bird @ 2017-10-27  2:15 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

Hi, Can we just rewrite rainbow-mode to use overlay instead? Is 
that a reason that it doesn't do so? 

regards,

Drew Adams <drew.adams@oracle.com> writes:

>> How can I make hl-line mode not override the color of
>> rainbow-mode?
>> 
>> https://urldefense.proofpoint.com/v2/url?u=https-
>> 3A__i.stack.imgur.com_fh11k.png&d=DwIBAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5Y
>> TpkKY057SbK10&r=qZLZosY6GBAaJtOG9v8QX7nD4BS9t9s5otgxC3d4IFU&m=0cysGUafKkn
>> 05ieu20oYLMZxbhi3LmzWz2B2DcaeCgY&s=IUgAkHZTo4jnGih15NlP4kUZj-kXymJcX-
>> KgBbBlIbA&e=
>> 
>> Is there an non-intrusive way to do this?
>
> https://emacs.stackexchange.com/a/23965/105
>
> `rainbow-mode' uses text properties to highlight.
> `hl-line-mode' uses an overlay to highlight.
> Overlay highlighting overrides text-property highlighting.


-- 
Amos Bird
amosbird@gmail.com



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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-27  2:15   ` Amos Bird
@ 2017-10-27  2:24     ` Emanuel Berg
  2017-10-27  3:22       ` Amos Bird
  2017-10-27  5:02       ` Yuri Khan
  0 siblings, 2 replies; 11+ messages in thread
From: Emanuel Berg @ 2017-10-27  2:24 UTC (permalink / raw)
  To: help-gnu-emacs

Amos Bird wrote:

> Hi, Can we just rewrite rainbow-mode to use
> overlay instead? Is that a reason that it
> doesn't do so?

Don't you think you are going overboard with
this cosmetic detail which only appears in
rare combinations?

-- 
underground experts united
http://user.it.uu.se/~embe8573




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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-27  2:24     ` Emanuel Berg
@ 2017-10-27  3:22       ` Amos Bird
  2017-10-27  5:02       ` Yuri Khan
  1 sibling, 0 replies; 11+ messages in thread
From: Amos Bird @ 2017-10-27  3:22 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs


Hi, it's indeed quite simple. I've managed to get it working :)

https://github.com/amosbird/rainbow-mode 

regards,

Emanuel Berg <moasen@zoho.com> writes:

> Amos Bird wrote:
>
>> Hi, Can we just rewrite rainbow-mode to use
>> overlay instead? Is that a reason that it
>> doesn't do so?
>
> Don't you think you are going overboard with
> this cosmetic detail which only appears in
> rare combinations?


-- 
Amos Bird
amosbird@gmail.com



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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-27  2:24     ` Emanuel Berg
  2017-10-27  3:22       ` Amos Bird
@ 2017-10-27  5:02       ` Yuri Khan
  2017-10-27  5:39         ` Emanuel Berg
  2017-10-27  7:23         ` Eli Zaretskii
  1 sibling, 2 replies; 11+ messages in thread
From: Yuri Khan @ 2017-10-27  5:02 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

On Fri, Oct 27, 2017 at 9:24 AM, Emanuel Berg <moasen@zoho.com> wrote:
> Amos Bird wrote:
>
>> Hi, Can we just rewrite rainbow-mode to use
>> overlay instead? Is that a reason that it
>> doesn't do so?
>
> Don't you think you are going overboard with
> this cosmetic detail which only appears in
> rare combinations?

It may be a rare combination for you, because you are using Emacs on a
Linux console that only supports a few colors and therefore it doesn’t
make much sense to use background color for highlighting.

It may be a rare combination overall, counting all users of Emacs together.

But, for a user who likes seeing the current line highlighted at all
times and also wants to highlight CSS colors, it’s going to be pretty
frequent.


(I wish there was a way to make overlays interact better with text
properties. hl-line takes precedence over pretty much any background
color highlighting, including but not limited to hi-lock, rainbow-mode
and Magit branch and tag decorations. The intuitive expectation, for
hl-line, would be that it should override background color only if it
comes directly or indirectly from the default face.)



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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-27  5:02       ` Yuri Khan
@ 2017-10-27  5:39         ` Emanuel Berg
  2017-10-27  7:23         ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Emanuel Berg @ 2017-10-27  5:39 UTC (permalink / raw)
  To: help-gnu-emacs

Yuri Khan wrote:

> It may be a rare combination for you, because
> you are using Emacs on a Linux console that
> only supports a few colors and therefore it
> doesn’t make much sense to use background
> color for highlighting.

Actually I'm very picky with my colors! I call
my color scheme "Orange Sunshine" after ALD-52.
Nah, I just made that up :)

    http://user.it.uu.se/~embe8573/dumps/faces-2.png

(pnmtopng: 12 colors found)

However I'm unsure if more colors (higher
number of different colors) actually make it
more colorful or if it is like 11 watching down
meters - up and till ~11 m, it gets scarier and
scarier, but above that, one can add a hundred
meters just as well and it doesn't get any
more scary!

Background colors are perhaps just what is
underpowered tho, at least I didn't use them
that much, so perhaps that is indicative too
heavy-handed to be useful...

> It may be a rare combination overall,
> counting all users of Emacs together.

Plus, who cares if just one user wants it as
long as he (she?? colors) is the one who
does it? It is always like that. Well,
sometimes you wish it weren't like that, but
put it this way, it is good that it *can* be
like that!

> But, for a user who likes seeing the current
> line highlighted at all times and also wants
> to highlight CSS colors, it’s going to be
> pretty frequent.

Right, CSS, good point.

-- 
underground experts united
http://user.it.uu.se/~embe8573




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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-27  5:02       ` Yuri Khan
  2017-10-27  5:39         ` Emanuel Berg
@ 2017-10-27  7:23         ` Eli Zaretskii
  2017-10-27  8:33           ` Yuri Khan
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2017-10-27  7:23 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Yuri Khan <yuri.v.khan@gmail.com>
> Date: Fri, 27 Oct 2017 12:02:34 +0700
> 
> (I wish there was a way to make overlays interact better with text
> properties. hl-line takes precedence over pretty much any background
> color highlighting, including but not limited to hi-lock, rainbow-mode
> and Magit branch and tag decorations.

This could be alleviated by using less intrusive face attributes for
the hl-line face.  For example, one could use underline, or
bold/slant, or box, or something else that doesn't override the
colors, while still making the current line stand out on display.

> The intuitive expectation, for hl-line, would be that it should
> override background color only if it comes directly or indirectly
> from the default face.)

I think I disagree, but then I don't use hl-line in my routine usage,
so maybe my opinion isn't worth much.



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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-27  7:23         ` Eli Zaretskii
@ 2017-10-27  8:33           ` Yuri Khan
  2017-10-27  9:04             ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Yuri Khan @ 2017-10-27  8:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs@gnu.org

On Fri, Oct 27, 2017 at 2:23 PM, Eli Zaretskii <eliz@gnu.org> wrote:

>> (I wish there was a way to make overlays interact better with text
>> properties. hl-line takes precedence over pretty much any background
>> color highlighting, including but not limited to hi-lock, rainbow-mode
>> and Magit branch and tag decorations.
>
> This could be alleviated by using less intrusive face attributes for
> the hl-line face.  For example, one could use underline, or
> bold/slant, or box, or something else that doesn't override the
> colors, while still making the current line stand out on display.

The idea of hl-line is not to make the current line “stand out” as
such. It is a delicate balance of several desirable properties:

1. The current line needs to be immediately noticeable.
  a. Even if it contains no characters or contains only whitespace.
2. The current line should not be too distracting.
  a. In particular, it must not cause glyphs shifting when point moves.
3. The current line is secondary to any characteristics of the text in
the buffer.

A very subtle change in background color (on the order of 8 gray
levels out of 256) fits those criteria except 3. Bold, slant and
underline fail #1a. Box fails #2a when the box line width is positive,
and sometimes also when negative. (In an *Info* buffer, a negative box
still causes shifting for me on Emacs 25.1.) If the box line width is
negative and big enough that it gives the effect of text background,
it also fails #3.

>> The intuitive expectation, for hl-line, would be that it should
>> override background color only if it comes directly or indirectly
>> from the default face.)
>
> I think I disagree, but then I don't use hl-line in my routine usage,
> so maybe my opinion isn't worth much.

That’s why I’m offering my opinion, which I acquired through 10 years
of Emacs and a few years of other editors before that.

(Of course I understand programming that behavior is technically
difficult given the overall scheme of things. An overlay is just not a
good enough fit for hl-line; an “underlay” would be more like it.)



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

* Re: How can I make hl-line mode not override the color of rainbow-mode?
  2017-10-27  8:33           ` Yuri Khan
@ 2017-10-27  9:04             ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2017-10-27  9:04 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Yuri Khan <yuri.v.khan@gmail.com>
> Date: Fri, 27 Oct 2017 15:33:00 +0700
> Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> 
> > This could be alleviated by using less intrusive face attributes for
> > the hl-line face.  For example, one could use underline, or
> > bold/slant, or box, or something else that doesn't override the
> > colors, while still making the current line stand out on display.
> 
> The idea of hl-line is not to make the current line “stand out” as
> such. It is a delicate balance of several desirable properties:
> 
> 1. The current line needs to be immediately noticeable.
>   a. Even if it contains no characters or contains only whitespace.
> 2. The current line should not be too distracting.
>   a. In particular, it must not cause glyphs shifting when point moves.
> 3. The current line is secondary to any characteristics of the text in
> the buffer.

Not everyone has all of these requirements for hl-line, and I think at
least some of my proposals do fit them, even though you didn't like
them (which is okay, but personal preferences do matter here).

IOW, this is an optional feature, used for different reasons.  There
are no absolutely correct and absolutely incorrect opinions here.  The
purpose of my message was to point out a few non-default alternatives
which could improve the quality of life for some of those who read
this list.  I understand and accept that some of the readers could
reject my proposals, per their personal preferences, but that doesn't
mean they should be rejected outright or considered invalid.

As for this:

> I wish there was a way to make overlays interact better with text
> properties.

If you have specific ideas for how to accomplish this, feel free to
describe them (on emacs-devel, preferably), maybe we can do something
about this.  The basic issue here is how to deal with the situation
where two different sources specify the background color of the same
buffer position.  Emacs currently selects one of those 2 sources by
using a priority scheme.



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

end of thread, other threads:[~2017-10-27  9:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-26 16:27 How can I make hl-line mode not override the color of rainbow-mode? Amos Bird
2017-10-26 21:54 ` Emanuel Berg
2017-10-26 23:10 ` Drew Adams
2017-10-27  2:15   ` Amos Bird
2017-10-27  2:24     ` Emanuel Berg
2017-10-27  3:22       ` Amos Bird
2017-10-27  5:02       ` Yuri Khan
2017-10-27  5:39         ` Emanuel Berg
2017-10-27  7:23         ` Eli Zaretskii
2017-10-27  8:33           ` Yuri Khan
2017-10-27  9:04             ` Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.