From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Merging the underline attribute at EOL Date: Mon, 16 Dec 2019 18:17:36 +0200 Message-ID: <83zhfs453z.fsf@gnu.org> References: <83eex771ky.fsf@gnu.org> <20191216034901.amvufpomffmjaivy@Ergus> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="64334"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 16 17:18:21 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1igt4e-000GZy-Lx for ged-emacs-devel@m.gmane.org; Mon, 16 Dec 2019 17:18:20 +0100 Original-Received: from localhost ([::1]:56370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igt4c-0003bV-MK for ged-emacs-devel@m.gmane.org; Mon, 16 Dec 2019 11:18:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50571) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igt4C-0003bL-Jf for emacs-devel@gnu.org; Mon, 16 Dec 2019 11:17:54 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1igt4C-0006vw-FY; Mon, 16 Dec 2019 11:17:52 -0500 Original-Received: from [176.228.60.248] (port=4159 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1igt4B-0003sD-N5; Mon, 16 Dec 2019 11:17:52 -0500 In-reply-to: <20191216034901.amvufpomffmjaivy@Ergus> (message from Ergus on Mon, 16 Dec 2019 04:49:01 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:243418 Archived-At: > Date: Mon, 16 Dec 2019 04:49:01 +0100 > From: Ergus > Cc: emacs-devel@gnu.org > > Actually this seems to be related with the face merge we do latter to > fill the space until the window edge and how we calculate > extend_face_id. > > It is taking the text-properties in the call to face_at_pos just before > the condition you mention. Yes. there's no problem with the face calculation in face_at_pos. The problem is that under some conditions we decide to return early from this function, and thus don't extend the face computed by face_at_pos. > So the problem seems to be in face_at_buffer_position in these lines: > > /* Merge in attributes specified via text properties. */ > if (!NILP (prop)) > merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter); > > So maybe that is the condition we need to extend... > > As a dumb test I just did: > > if (!NILP (prop) && attr_filter > 0) > merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter); When we call face_at_buffer_position from extend_face_to_end_of_line, attr_filter is always non-zero, so I cannot see how this could change anything. > And it seems to solve this specific issue (in tui and gui)... but it is > inconsistent and I am not aware of the possible side effects... > > Or probably we must fix this inside merge_face_ref. What do you think? I don't think the problem is in face_at_pos. The problem is that after we compute the face for extending, we don't apply it, but instead return, because neither the background color nor the box attribute tell us to continue with what the function does afterwards.