Subject: bug#489 closed by Chong Yidong <[email-masked]> (Re: Mouse highlighting bug)

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

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

#489: Mouse highlighting bug

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.

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

Subject: Re: Mouse highlighting bug
From: Chong Yidong <[email-masked]>
To: [email-masked]
Date: Sun, 21 Jun 2009 22:03:37 -0400

> (global-set-key [f1]
>   (lambda () (interactive)
>     (switch-to-buffer "asdf")
>     (erase-buffer)
>     (insert "123456\n890")
>     (put-text-property 4 9 'mouse-face 'highlight)
>     (put-text-property 4 9 'face (list :underline t))))
>
> Put the mouse over the region with mouse-highlight, then remove it.
> Result: the space after the first line becomes underlined.

I've checked a fix for this into the trunk, which involves changing
x_draw_glyph_string so that the underline (and overline) is not extended
into the end-of-line padding.  This is similar to the behavior of
strike-through.
>From [email-masked] Thu Jun 26 14:43:58 2008
From: Chong Yidong <[email-masked]>
To: [email-masked]
Subject: Mouse highlighting bug
Date: Thu, 26 Jun 2008 17:39:02 -0400

There seems to be a bug is how mouse-face highlighting handles extending
faces to the end of the line:

(global-set-key [f1]
  (lambda () (interactive)
    (switch-to-buffer "asdf")
    (erase-buffer)
    (insert "123456\n890")
    (put-text-property 4 9 'mouse-face 'highlight)
    (put-text-property 4 9 'face (list :underline t))))

Put the mouse over the region with mouse-highlight, then remove it.
Result: the space after the first line becomes underlined.