From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83obrmtbsy.fsf@gnu.org> References: <1BE52A40-0403-433F-8164-DFDBD6771F80@gmail.com> <83ty1fvc28.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1332592692 27172 80.91.229.3 (24 Mar 2012 12:38:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Mar 2012 12:38:12 +0000 (UTC) Cc: 11068@debbugs.gnu.org To: darthandrus@gmail.com, Stefan Monnier , Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 24 13:38:11 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SBQEU-0002gm-Qw for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Mar 2012 13:38:11 +0100 Original-Received: from localhost ([::1]:45960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQEU-0004b8-8E for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Mar 2012 08:38:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQEQ-0004aU-P1 for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:38:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBQEO-0003Uu-Lq for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:38:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBQEO-0003Um-IF for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 08:38:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SBQiM-0006LX-Dr for bug-gnu-emacs@gnu.org; Sat, 24 Mar 2012 09:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Mar 2012 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11068 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11068-submit@debbugs.gnu.org id=B11068.133259450124303 (code B ref 11068); Sat, 24 Mar 2012 13:09:02 +0000 Original-Received: (at 11068) by debbugs.gnu.org; 24 Mar 2012 13:08:21 +0000 Original-Received: from localhost ([127.0.0.1]:36397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBQhg-0006Jv-IQ for submit@debbugs.gnu.org; Sat, 24 Mar 2012 09:08:21 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:35018) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SBQhd-0006Jm-T8 for 11068@debbugs.gnu.org; Sat, 24 Mar 2012 09:08:19 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M1E00F002V6ZA00@a-mtaout22.012.net.il> for 11068@debbugs.gnu.org; Sat, 24 Mar 2012 14:37:18 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.241.151]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M1E00F2Q325Z420@a-mtaout22.012.net.il>; Sat, 24 Mar 2012 14:37:18 +0200 (IST) In-reply-to: <83ty1fvc28.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58078 Archived-At: > Date: Fri, 23 Mar 2012 12:36:31 +0200 > From: Eli Zaretskii > 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; }