emacs-devel
[Top][All Lists]
Advanced

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

RE: can we please define a face for compile.el mouseover?


From: Drew Adams
Subject: RE: can we please define a face for compile.el mouseover?
Date: Tue, 15 Feb 2011 14:43:49 -0800

> Is there any code in Emacs that does _not_ use `highlight' for
> mouse-face?

Yes.  Didn't I mention face `mode-line-highlight' explicitly?

> If not (or if the other cases are a very small minority), this should
> probably be fixed for Emacs in general, not just in compile.el.

IMO, it should not be fixed by imposing one single mouseover face for all of
Emacs.  That would only let you customize it one way for all contexts.  That
would make it impossible to customize different faces for the different contexts
(duh).  Why force users to use the same face for mode-line and grep mouseover
highlighting?

Most mouseover highlighting is for short sections of text such as names.  Some
mouseover highlighting is for things like buttons - and Emacs already uses
different faces here (in some cases hard-coded - see `mpc-volume-widget' for
instance; in other cases, such as the mode line, customizable).  And some
mouseover is for a whole text line or table row (I use that for grep, for
instance).

Those are different highlighting contexts and can reasonably call for different
highlighting appearances.  At least users can be given the possibility.

There is nothing wrong with defining one face for mouseover for compilation/grep
and another face for mouseover on the mode line, and having them both inherit
from the same face (or not).  Attempting to boil all mouseover highlighting down
to the same face would be misguided - only one step above hard-coding
`highlight' all over the place.

In my case, speaking as one user, I want most mouseover to use `highlight', but
for the mode line I want it to use `mode-line-highlight' (which it does), and
for compilation/grep I want it to use another highlighting style altogether (in
my case it just underlines).

I've grepped for `mouse-face' in the Emacs source code, and those three are the
only contexts that I use where I would want to customize the face used for
mouseover.  But other people use libraries that I don't use, and perhaps they
would suggest additional places to define a new face.  If not, then let's just
add a mouseover face for compile.el.

> Also, someone should perhaps see if using arbitrary faces for mouse
> highlight will not be too dangerous (given how this is implemented in
> the display engine), before we allow to customize it.

Dangerous?  I've been customizing it exactly the way I said for decades (using
face `compilation-mouseover').  Not only that, I put the `mouse-face' property
on the whole grep line, not just on the file name+lineno part.  And I have never
seen any problem, display or otherwise (even with huge grep buffers).




reply via email to

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