From: Eli Zaretskii <eliz@gnu.org>
To: darthandrus@gmail.com, Stefan Monnier <monnier@iro.umontreal.ca>,
Chong Yidong <cyd@stupidchicken.com>
Cc: 11068@debbugs.gnu.org
Subject: bug#11068: 24.0.94; Face-remapped background does not extend to end of window
Date: Sat, 24 Mar 2012 14:37:17 +0200 [thread overview]
Message-ID: <83obrmtbsy.fsf@gnu.org> (raw)
In-Reply-To: <83ty1fvc28.fsf@gnu.org>
> Date: Fri, 23 Mar 2012 12:36:31 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 11068@debbugs.gnu.org
>
> This is how Emacs display engine always worked: the non-text parts of
> the window display are drawn in the default face. (Remapping does not
> change the default face, as far as Emacs internals are concerned, it
> just substitutes a different face in its stead, leaving the literal
> DEFAULT_FACE_ID intact.)
>
> So this bug has rather low priority at this time, as it's not a
> regression wrt Emacs 23. Time permitting, I will at the very least
> try to figure out what changes are needed to make this work as
> expected.
The patch below makes Emacs work as expected in this case. Whether to
install this now or wait until after Emacs 24.1, is up to Stefan and
Chong.
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c 2012-03-24 12:33:40 +0000
+++ b/src/xdisp.c 2012-03-24 12:34:53 +0000
@@ -18173,7 +18173,12 @@
it->len = 1;
if (default_face_p)
- it->face_id = DEFAULT_FACE_ID;
+ {
+ if (NILP (Vface_remapping_alist))
+ it->face_id = DEFAULT_FACE_ID;
+ else
+ it->face_id = lookup_basic_face (it->f, DEFAULT_FACE_ID);
+ }
else if (it->face_before_selective_p)
it->face_id = it->saved_face_id;
face = FACE_FROM_ID (it->f, it->face_id);
@@ -18209,7 +18214,7 @@
static void
extend_face_to_end_of_line (struct it *it)
{
- struct face *face;
+ struct face *face, *default_face;
struct frame *f = it->f;
/* If line is already filled, do nothing. Non window-system frames
@@ -18223,11 +18228,16 @@
&& !it->glyph_row->continued_p))
return;
+ /* The default face, possibly remapped. */
+ default_face = FACE_FROM_ID (f, lookup_basic_face (f, DEFAULT_FACE_ID));
+
/* Face extension extends the background and box of IT->face_id
to the end of the line. If the background equals the background
of the frame, we don't have to do anything. */
if (it->face_before_selective_p)
face = FACE_FROM_ID (f, it->saved_face_id);
+ else if (it->face_id == DEFAULT_FACE_ID)
+ face = default_face;
else
face = FACE_FROM_ID (f, it->face_id);
@@ -18260,7 +18270,7 @@
if (it->glyph_row->used[TEXT_AREA] == 0)
{
it->glyph_row->glyphs[TEXT_AREA][0] = space_glyph;
- it->glyph_row->glyphs[TEXT_AREA][0].face_id = it->face_id;
+ it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id;
it->glyph_row->used[TEXT_AREA] = 1;
}
#ifdef HAVE_WINDOW_SYSTEM
@@ -18296,7 +18306,7 @@
face, to avoid painting the rest of the window with
the region face, if the region ends at ZV. */
if (it->glyph_row->ends_at_zv_p)
- it->face_id = DEFAULT_FACE_ID;
+ it->face_id = default_face->id;
else
it->face_id = face->id;
append_stretch_glyph (it, make_number (0), stretch_width,
@@ -18329,7 +18339,7 @@
avoid painting the rest of the window with the region face,
if the region ends at ZV. */
if (it->glyph_row->ends_at_zv_p)
- it->face_id = DEFAULT_FACE_ID;
+ it->face_id = default_face->id;
else
it->face_id = face->id;
@@ -18993,8 +19003,13 @@
/* A row that displays right-to-left text must always have
its last face extended all the way to the end of line,
even if this row ends in ZV, because we still write to
- the screen left to right. */
- if (row->reversed_p)
+ the screen left to right. We also need to extend the
+ last face if the default face is remapped to some
+ different face, otherwise the functions that clear
+ portions of the screen will clear with the default face's
+ background color. */
+ if (row->reversed_p
+ || lookup_basic_face (it->f, DEFAULT_FACE_ID) != DEFAULT_FACE_ID)
extend_face_to_end_of_line (it);
break;
}
next prev parent reply other threads:[~2012-03-24 12:37 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 20:49 bug#11068: 24.0.94; Face-remapped background does not extend to end of window Ivan Andrus
[not found] ` <handler.11068.B.13324512277363.ack@debbugs.gnu.org>
2012-03-22 21:18 ` bug#11068: Acknowledgement (24.0.94; Face-remapped background does not extend to end of window) Ivan Andrus
2012-03-22 21:33 ` Glenn Morris
2012-03-22 21:31 ` bug#11069: 24.0.94; Face-remapped background does not extend to end of window Glenn Morris
2012-03-23 10:36 ` bug#11068: " Eli Zaretskii
2012-03-23 10:48 ` Ivan Andrus
2012-03-24 12:37 ` Eli Zaretskii [this message]
2012-03-24 13:42 ` martin rudalics
2012-03-24 14:12 ` Eli Zaretskii
2012-03-24 19:48 ` martin rudalics
2012-03-24 20:47 ` Eli Zaretskii
2012-03-25 12:54 ` martin rudalics
2012-03-25 17:22 ` Eli Zaretskii
2012-03-25 19:19 ` martin rudalics
2012-03-25 19:53 ` Stefan Monnier
2012-03-25 20:44 ` martin rudalics
2012-03-25 21:49 ` Eli Zaretskii
2012-03-25 21:53 ` Eli Zaretskii
2012-03-26 7:05 ` martin rudalics
2012-03-26 19:32 ` Eli Zaretskii
2012-03-27 9:23 ` martin rudalics
2012-03-27 18:40 ` Eli Zaretskii
2012-03-30 7:35 ` martin rudalics
2012-03-30 8:18 ` Eli Zaretskii
2012-03-30 10:14 ` martin rudalics
2012-03-30 11:42 ` Eli Zaretskii
2012-03-31 10:29 ` Eli Zaretskii
2012-03-30 10:47 ` martin rudalics
2012-03-24 18:04 ` Stefan Monnier
2012-03-24 19:48 ` martin rudalics
2012-03-24 14:17 ` Chong Yidong
2012-03-24 14:40 ` Eli Zaretskii
2012-03-25 3:01 ` Chong Yidong
2012-03-25 4:02 ` Eli Zaretskii
2012-03-25 6:20 ` Chong Yidong
2012-03-25 12:55 ` martin rudalics
2012-03-25 17:26 ` Eli Zaretskii
2012-03-25 19:20 ` martin rudalics
2012-03-25 17:51 ` Eli Zaretskii
2012-03-26 4:16 ` Chong Yidong
2012-03-26 19:35 ` Eli Zaretskii
2012-03-30 8:49 ` Eli Zaretskii
2012-03-25 12:54 ` martin rudalics
2012-03-25 17:25 ` Eli Zaretskii
2012-03-25 19:19 ` martin rudalics
2012-03-25 21:50 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83obrmtbsy.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=11068@debbugs.gnu.org \
--cc=cyd@stupidchicken.com \
--cc=darthandrus@gmail.com \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.