From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Identifying the face between STRETCH and right fringe. Date: Tue, 27 Nov 2018 11:34:50 +0200 Message-ID: <83a7luhnid.fsf@gnu.org> References: <83h8gbis2d.fsf@gnu.org> <83zhu0f6tt.fsf@gnu.org> <83sgzrgb1f.fsf@gnu.org> <83r2fbg5bq.fsf@gnu.org> <83lg5jfs9o.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1543312391 30515 195.159.176.226 (27 Nov 2018 09:53:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Nov 2018 09:53:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 27 10:53:07 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRa3E-0007mJ-VT for ged-emacs-devel@m.gmane.org; Tue, 27 Nov 2018 10:53:05 +0100 Original-Received: from localhost ([::1]:40998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRa5L-0001VC-Fh for ged-emacs-devel@m.gmane.org; Tue, 27 Nov 2018 04:55:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRZlW-0008Ju-7p for emacs-devel@gnu.org; Tue, 27 Nov 2018 04:34:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRZlT-0007Uu-3j for emacs-devel@gnu.org; Tue, 27 Nov 2018 04:34:46 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRZlT-0007Uq-15; Tue, 27 Nov 2018 04:34:43 -0500 Original-Received: from [176.228.60.248] (port=2763 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gRZlS-00042K-Lf; Tue, 27 Nov 2018 04:34:42 -0500 In-reply-to: (message from Robert Pluim on Tue, 27 Nov 2018 09:56:36 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231438 Archived-At: > From: Robert Pluim > Cc: emacs-devel@gnu.org > Date: Tue, 27 Nov 2018 09:56:36 +0100 > > Itʼs ns_dumpglyphs_stretch, which is doing exactly as itʼs told: > drawing the background to the right edge of the frame. Thatʼs because > in xdisp.c:display_line we have: > > /* Make sure that a non-default face is extended > up to the right margin of the window. */ > extend_face_to_end_of_line (it); > > which later causes set_glyph_string_background_width to set the > background_width of the glyph to the full width (commenting out that > call makes NS work the same as X11 for this specific case). > > What I donʼt understand is that under X11 Emacs takes exactly the same > code path, yet somehow it doesnʼt end up setting the background up to > the right edge. On a GUI frame, extend_face_to_end_of_line is supposed to return almost immediately, here: if (FRAME_WINDOW_P (f) && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) && face->box == FACE_NO_BOX && face->background == FRAME_BACKGROUND_PIXEL (f) #ifdef HAVE_WINDOW_SYSTEM && !face->stipple #endif && !it->glyph_row->reversed_p) return; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< The exceptions are: (a) when we break a line in the middle of a face whose background is different from the default face, or (b) when the default face has the box or the stipple attribute set, or (b) if the screen line is displayed right-to-left And none of those should be the case here. So the question becomes: why doesn't NS reset it->face to the default face, like it's supposed to? We are already done with displaying the stretch glyph, so its face should be bygone. Let me know if you need guidance for where to look for the answers. Thanks.