unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: can we please define a face for compile.el mouseover?
Date: Tue, 15 Feb 2011 14:43:49 -0800	[thread overview]
Message-ID: <CEC864DA261A435EA7D329BE6959B8A5@us.oracle.com> (raw)
In-Reply-To: <834o85f5jv.fsf@gnu.org>

> 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	other threads:[~2011-02-15 22:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 19:26 can we please define a face for compile.el mouseover? Drew Adams
2011-02-15 19:42 ` Eli Zaretskii
2011-02-15 22:43   ` Drew Adams [this message]
2011-02-15 21:12 ` Stefan Monnier
2011-02-15 22:41   ` Drew Adams
2011-02-16  2:32     ` Stefan Monnier
2011-02-16  4:03       ` Drew Adams
2011-02-19 21:11         ` Stefan Monnier
2011-02-19 21:32           ` Chong Yidong

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CEC864DA261A435EA7D329BE6959B8A5@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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 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).