Subject: bug#26 closed by Chong Yidong <[email-masked]> (Re: bug#26: Consistent underline face end of line to edge extension on X)

From: [email-masked] (Emacs bug Tracking System)
Date: Sat, 27 Jun 2009 23:10:05 +0000

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

#26: Consistent underline face end of line to edge extension on X

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.

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

Subject: Re: bug#26: Consistent underline face end of line to edge extension on X
From: Chong Yidong <[email-masked]>
To: David De La Harpe Golden <[email-masked]>
Cc: [email-masked]
Date: Sat, 27 Jun 2009 19:03:21 -0400

> Anyway, if you do consider it a bug that that extension happens, then
> just making underline and overline drawing use width rather than
> background_width (like overstrike) in src/xterm.c probably resolves
> that? (at least on bitmapped displays)

I've checked in this fix into the CVS trunk (independently arrived at
for Bug#489).

Thanks.
>From [email-masked] Sun Mar  2 16:05:24 2008
Date: Mon, 03 Mar 2008 00:05:04 +0000
From: David De La Harpe Golden <[email-masked]>
To: [email-masked]
Subject: Consistent underline face end of line to edge extension on X

This is a multi-part message in MIME format.
--------------020705060304040409090504
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Package: emacs
Version: 23.0.60
Severity: minor
Tags: patch

As per emacs-devel post [1]

On X displays, when an overlay's face has underline (or overstrike
or strikethrough) set, when it crosses line end, it is only extended
to window edge when a background different to the frame background is
also set in the face.  This is different behaviour to terminal displays.

It really only matters for "unconventional" uses of
underline/overline/strikethrough through, such as use in a "show old
window position" hack [2][3]

Easily "fixed", patch attached.

[1] http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg00071.html
[2] http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg03044.html
[3] http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg03045.html

--------------020705060304040409090504
Content-Type: text/x-patch;
 name="xdisp_extend_underline_to_edge.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="xdisp_extend_underline_to_edge.diff"

Index: src/xdisp.c
===================================================================
RCS file: /sources/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1198
diff -u -r1.1198 xdisp.c
--- src/xdisp.c	29 Feb 2008 03:12:27 -0000	1.1198
+++ src/xdisp.c	2 Mar 2008 04:42:46 -0000
@@ -15968,6 +15968,9 @@
   if (FRAME_WINDOW_P (f)
       && it->glyph_row->displays_text_p
       && face->box == FACE_NO_BOX
+      && !face->underline_p
+      && !face->overline_p
+      && !face->strike_through_p
       && face->background == FRAME_BACKGROUND_PIXEL (f)
       && !face->stipple)
     return;
Index: src/xterm.c
===================================================================
RCS file: /sources/emacs/emacs/src/xterm.c,v
retrieving revision 1.980
diff -u -r1.980 xterm.c
--- src/xterm.c	1 Mar 2008 14:59:06 -0000	1.980
+++ src/xterm.c	2 Mar 2008 04:42:56 -0000
@@ -3024,7 +3024,7 @@
 	      XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
 	      XSetForeground (s->display, s->gc, s->face->strike_through_color);
 	      XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
-			      s->width, h);
+			      s->background_width, h);
 	      XSetForeground (s->display, s->gc, xgcv.foreground);
 	    }
 	}

--------------020705060304040409090504--