all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: How can I make hl-line mode not override the color of rainbow-mode?
Date: Fri, 27 Oct 2017 15:33:00 +0700	[thread overview]
Message-ID: <CAP_d_8Wg3UoidogN+RpdLswVw=W3YG48JFkSCS9sz5CihHeK=Q@mail.gmail.com> (raw)
In-Reply-To: <83r2tp6olw.fsf@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.)



  reply	other threads:[~2017-10-27  8:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-10-27  9:04             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP_d_8Wg3UoidogN+RpdLswVw=W3YG48JFkSCS9sz5CihHeK=Q@mail.gmail.com' \
    --to=yuri.v.khan@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.