unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* mouse-face vs. transient-mark-mode
@ 2005-04-22 21:46 JD Smith
  2005-04-22 23:00 ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: JD Smith @ 2005-04-22 21:46 UTC (permalink / raw)




When an overlay property of 'mouse-face 'highlight is set on a line,
and transient mark mode is on, and you attempt to drag out a new
region in the line, the region mark overlay does not show, and
significant flickering occurs as you drag the mouse inside the
highlighted text.  As soon as the mouse moves out of the mouse-face
area (either during the drag or after it's completed), the mark face
is visible.  The flickering is present even when transient-mark-mode
is disabled..

Is it possible to set a priority on either mouse-face or the region
highlight property to have the former yield to the latter?

Thanks,

JD

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

* RE: mouse-face vs. transient-mark-mode
  2005-04-22 21:46 mouse-face vs. transient-mark-mode JD Smith
@ 2005-04-22 23:00 ` Drew Adams
  2005-04-22 23:21   ` Luc Teirlinck
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2005-04-22 23:00 UTC (permalink / raw)


    When an overlay property of 'mouse-face 'highlight is set on a line,
    and transient mark mode is on, and you attempt to drag out a new
    region in the line, the region mark overlay does not show, and
    significant flickering occurs as you drag the mouse inside the
    highlighted text.  As soon as the mouse moves out of the mouse-face
    area (either during the drag or after it's completed), the mark face
    is visible.  The flickering is present even when transient-mark-mode
    is disabled..

    Is it possible to set a priority on either mouse-face or the region
    highlight property to have the former yield to the latter?

I can't answer your question definitively, JD, but I think the answer is
"no".

Caveat - The rest of this message is about a possible new feature, so it is
not intended for real discussion before the release. I mention it now as
food for thought, because of JD's request.

I mentioned a few months ago that I thought it be great if one could have a
mouse-face text property combine visually with the face text property:

    Ideally, I would love to be able to use underlining _without
    removing any font-lock highlighting_; that is, simply
    underline the text when you point to it, without changing
    any of its other properties. That's the behavior in
    most Web browsers.

I was speaking of using underline (for example) as the mouse-face, and I
mentioned only font-lock highlighting, but the general idea is to let the
mouse-face show up in combination with the face. That way, you could see the
normal (font-lock) highlighting as well as things like the region.

Of course, the desired effect would only be achieved if the two (mouse-face
& face) combined well. JD's request for being able to set a precedence might
fit here.

As I mentioned previously:

    I'm not sure if that's easy to do, or even feasible, in Emacs

I don't know much about face inheritance, but perhaps that could be used
somehow in this regard.

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

* Re: mouse-face vs. transient-mark-mode
  2005-04-22 23:00 ` Drew Adams
@ 2005-04-22 23:21   ` Luc Teirlinck
  2005-04-22 23:50     ` JD Smith
  0 siblings, 1 reply; 6+ messages in thread
From: Luc Teirlinck @ 2005-04-22 23:21 UTC (permalink / raw)
  Cc: emacs-devel

Drew Adams wrote:

       Is it possible to set a priority on either mouse-face or the region
       highlight property to have the former yield to the latter?

   I can't answer your question definitively, JD, but I think the answer is
   "no".

I am not sure whether JD's question was whether it was _possible_ to
give overlays different priorities in general or whether it would be
OK to do so it in the particular case referred to.  In as far as the
first question is concerned, `(overlay-put OVERLAY 'priority VALUE)
should do it.  See `(elisp)Overlay Properties'.

Sincerely,

Luc.

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

* Re: mouse-face vs. transient-mark-mode
  2005-04-22 23:21   ` Luc Teirlinck
@ 2005-04-22 23:50     ` JD Smith
  2005-04-23  0:54       ` Luc Teirlinck
  2005-04-23 22:24       ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: JD Smith @ 2005-04-22 23:50 UTC (permalink / raw)


On Fri, 22 Apr 2005 18:21:01 -0500, Luc Teirlinck wrote:

> Drew Adams wrote:
> 
>        Is it possible to set a priority on either mouse-face or the region
>        highlight property to have the former yield to the latter?
> 
>    I can't answer your question definitively, JD, but I think the answer is
>    "no".
> 
> I am not sure whether JD's question was whether it was _possible_ to
> give overlays different priorities in general or whether it would be
> OK to do so it in the particular case referred to.  In as far as the
> first question is concerned, `(overlay-put OVERLAY 'priority VALUE)
> should do it.  See `(elisp)Overlay Properties'.

Thanks for the comments.  In fact I _was_ inquiring if it was possible
to do.

As you suggest, I can change the priority for my own overlays, such as
the 'mouse-face 'highlight mentioned, but I can't seem to get that
setting (positive, negative, whatever) to affect the region highlighting
while the mouse is on the line with 'mouse-face set.  No matter what, the
region highlighting is not visible, and substantial flickering occurs as
regions are dragged into existence.  I'm not even sure that region
highlighting is implemented as an overlay; it may be a text property, and,
correct me if I'm wrong, overlays always have higher priority, regardless
of their 'priority property.  Is there some way you know of giving the
region highlighting higher priority?

Thanks again,

JD

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

* Re: mouse-face vs. transient-mark-mode
  2005-04-22 23:50     ` JD Smith
@ 2005-04-23  0:54       ` Luc Teirlinck
  2005-04-23 22:24       ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Luc Teirlinck @ 2005-04-23  0:54 UTC (permalink / raw)
  Cc: emacs-devel

JD Smith wrote:

   I'm not even sure that region highlighting is implemented as an
   overlay; it may be a text property, and, correct me if I'm wrong,
   overlays always have higher priority, regardless of their 'priority
   property.  Is there some way you know of giving the region
   highlighting higher priority?

Somebody more familiar with the internals of region highlighting will
have to answer the last question.  I did not look at those internals,
but I believe that the region highlighting is just a display feature
and neither implemented a a text property nor as an overlay.  Text
properties are for longer lasting stuff.  If it were a text property,
activating the region  would mark the buffer modified.

Sincerely,

Luc.

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

* Re: mouse-face vs. transient-mark-mode
  2005-04-22 23:50     ` JD Smith
  2005-04-23  0:54       ` Luc Teirlinck
@ 2005-04-23 22:24       ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2005-04-23 22:24 UTC (permalink / raw)
  Cc: emacs-devel

      I'm not even sure that region
    highlighting is implemented as an overlay; it may be a text property, and,
    correct me if I'm wrong, overlays always have higher priority, regardless
    of their 'priority property.

Last I looked, region-highlighting was implemented with special C
support, and always overrides all `face' properties.  However,
`mouse-face' highlighting is also implemented with special C code.
Although it is controlled by text and overlay properties, the bounds
are recorded, and the highlighting itself is handled specially in the
signal handler so it can respond to low level mouse-motion X events.

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

end of thread, other threads:[~2005-04-23 22:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-22 21:46 mouse-face vs. transient-mark-mode JD Smith
2005-04-22 23:00 ` Drew Adams
2005-04-22 23:21   ` Luc Teirlinck
2005-04-22 23:50     ` JD Smith
2005-04-23  0:54       ` Luc Teirlinck
2005-04-23 22:24       ` Richard Stallman

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).