Subject: bug#1220 closed by Chong Yidong <[email-masked]> (Re: overlay before- and after-string and mouse-face)

From: [email-masked] (Emacs bug Tracking System)
Date: Mon, 22 Jun 2009 02:00:06 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#1220: overlay before- and after-string and mouse-face

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
1220: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1220
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: overlay before- and after-string and mouse-face
From: Chong Yidong <[email-masked]>
To: [email-masked]
Date: Sun, 21 Jun 2009 21:55:34 -0400

> The mouse-face property of an overlay with a display string does not
> affect any before-string, but it does affect the after-string.
>
> This can be worked around to some extent by copying the mouse-face
> property to the before-string, but one cannot get the whole overlay
> highlighted at one time.

I've checked a fix for this into the trunk.
>From [email-masked] Tue Oct 21 17:41:57 2008
From: Glenn Morris <[email-masked]>
To: [email-masked]
Subject: overlay before- and after-string and mouse-face
Date: Tue, 21 Oct 2008 20:39:13 -0400

Package: emacs
Version: 23.0.60

This bug is extracted from #1176, which contained several issues.

The mouse-face property of an overlay with a display string does not
affect any before-string, but it does affect the after-string.

This can be worked around to some extent by copying the mouse-face
property to the before-string, but one cannot get the whole overlay
highlighted at one time.

Example:

(let ((buff (generate-new-buffer "overlay test"))
      o)
  (with-current-buffer buff
    (insert "text")
    (setq o (make-overlay (point-min) (point-max)))
    (overlay-put o 'mouse-face '(:background "green"))
    (overlay-put o 'display "display")
    (overlay-put o 'before-string "before string")
    (overlay-put o 'after-string "after string")
    (pop-to-buffer buff)))

"displayafter string" has mouse-face, but "before string" does not.