unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "David De La Harpe Golden" <david.delaharpe.golden@gmail.com>
To: "Miles Bader" <miles@gnu.org>
Cc: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>,
	Tassilo Horn <tassilo@member.fsf.org>,
	David O'Toole <dto@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Extending underline/overline/strikethrough to window edge on X
Date: Sun, 2 Mar 2008 04:52:58 +0000	[thread overview]
Message-ID: <8e24944a0803012052q7554670by36ccdacad35e88eb@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]

On 02/03/2008, David De La Harpe Golden
<david.delaharpe.golden@gmail.com> wrote:
> Working on that, noticed a difference between underlining on X and in
>  terminals: if a face has only underline set on a terminal and the
>  overlay with that face passes the narrower-than-window-width line end,
>  then the underline extends to the right edge of the window - in this
>  case desirable to get a line all the way across the window.
>
>  If a face has only underline set on X, that doesn't happen,
>  only happens if the face also has a different background set to the
>  frame background.
>
>  Not really up to speed on the C code, but I guess to fix the issue
>  xdisp.c/extend_face_to_end_of_line() probably just needs a small
>  change to extend if underline is set, not just boxes, different
>  backgrounds and stipples.
>

Anyhow,

attached trivial patch fixes issue (and for overline and strikethrough too),
assuming it is an issue.

Note that the underline/overline was always drawn to edge if the
background happened to be different, so this only changes the
behaviour from existing behaviour when the face background is unset or
happens to match the frame background.  As such, it improves
consistency IMO.

strikethrough is a slightly different matter - unlike underline/overline it was
using the width not the background_width when drawn, but for
consistency it probably should use the same.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xdisp_extend_underline_to_edge.diff --]
[-- Type: text/x-diff; name=xdisp_extend_underline_to_edge.diff, Size: 1224 bytes --]

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);
 	    }
 	}

             reply	other threads:[~2008-03-02  4:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02  4:52 David De La Harpe Golden [this message]
2008-03-03  0:32 ` Extending underline/overline/strikethrough to window edge on X David De La Harpe Golden

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=8e24944a0803012052q7554670by36ccdacad35e88eb@mail.gmail.com \
    --to=david.delaharpe.golden@gmail.com \
    --cc=dto@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --cc=miles@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=tassilo@member.fsf.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).