Subject: Re: 26.1; Region highlight has lower priority than flymake overlays

From: João Távora <[email-masked]>
Date: Wed, 09 Jan 2019 20:52:05 +0000

Johann Klähn <[email-masked]> writes:

> I just noticed a bug (?) that region becomes de-facto "invisible" due
> to its highlight overlay having a lower priority than the flymake
> overlays. This only happens when both region and flymake diagnostics
> are indicated using the same face property (background in my case). It
> becomes more apparent for larger flymake overlays.
>
> Steps to reproduce, starting from emacs -Q:
>
> • M-: (set-face-background flymake-note "yellow green")

You probably mean 

(set-face-background 'flymake-note "yellow green")

> Flymake uses 100 as the offset to compute the default priority for its
> overlays:
> Is it intentional that 100 is used as the offset here? This has the
> effect that most priorities will be above that of the region overlay.

Yes, it was intentional.  Doesn't mean that it's correct :-) Perhaps it
should be reduced to the 50's region and also use the (nil . <value>),
form which I didn't know about (so thanks for showing me this).

I don't know if there are any guide-lines for interoperation in this
front, so if someone more knowledgeable than me want to chime in...

Anyway, for now, you can probably work around this with

   (push '(priority . (nil . 50)) (get :note 'flymake-overlay-control))

João