From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Merging the underline attribute at EOL Date: Mon, 16 Dec 2019 04:49:01 +0100 Message-ID: <20191216034901.amvufpomffmjaivy@Ergus> References: <83eex771ky.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="197337"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 16 04:49:40 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 1ighO6-000pDl-Sc for ged-emacs-devel@m.gmane.org; Mon, 16 Dec 2019 04:49:39 +0100 Original-Received: from localhost ([::1]:45934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ighO5-0003tb-4W for ged-emacs-devel@m.gmane.org; Sun, 15 Dec 2019 22:49:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59194) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ighNy-0003tO-C8 for emacs-devel@gnu.org; Sun, 15 Dec 2019 22:49:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ighNw-0003lk-PJ for emacs-devel@gnu.org; Sun, 15 Dec 2019 22:49:29 -0500 Original-Received: from sonic314-15.consmr.mail.bf2.yahoo.com ([74.6.132.125]:37583) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ighNw-0003eS-ER for emacs-devel@gnu.org; Sun, 15 Dec 2019 22:49:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1576468166; bh=SY8i3kYFT3tHL5oC/1NzqexI34sEq+LdAsygCHYYU3Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=YqJliZTH2514NhLCgha2c8aP4CgvUE5lIS7rFBpE745CjzjClW+sTXXRrlOIuU7sz0ViZnbOhoKlgjfvm9OpZ9rqFHd9RII4KCkbrRHyRCtmCqbTtJauQ1MULi/Dr8dTaO30gVFpe9eMW6gBDUARvua78GrmLabXAQVh5vr8fCD/K9+pifSQHRNoKgg5Pv5pUy+r8O3i3WLXj5elD5z018BlRnod7aYaw+awbPOs5ukr+QLQTTw/lhZ07TliWR3OcHNjnTF+7WS4H/nyDLHUzkLXyYKxjJTgaOhTrgpyASne5GQakHU+goAW3wFJIT5EYN7E7Z8Ssl7Ng/6kDD9IKg== X-YMail-OSG: hMUId2AVM1lVmOrZd.XL0c1aw3InuXVkurdutTg4DxSJTaw2EwdeYYiaKcfLIAm 9MkyG6eY79KJMH_BVyOBtWOfYmmal3YaLSMGG0L1Zex0wyX2aqmFX8pHoEHjZFzdTuXvHIfMCbL0 0v_c6RIrC5HoGn6K6xjjEMkXVBD_G1rtMaWiGtZug8bSuLq.TrNyppHnjPDopr8tFyNJOQ9wUJe2 xn6An8miNdOaLwhN_HygRhX2GBFD5un5wgasIKBfu7dX3nD3GNq0LTlu3ERh9HKVs2xRjlsUV8zA N4_xZVES9gt.OkSeKIUPZRdCDVb80QH27AxO6gb226Dii.lJxk6EtypcmvQKSnFvDmwokxegIqJ4 WZ94kxf4Y6TYlbB68pRUYzU2NXcSMt8hqGHt22hZCHx5XlK63B2Dl4128ATkOxx6MGkpQMthqkoe 9klrMbpGv9hxBDQbFSBmXy.QEjJ9McgG7Iqx4maRet6uJUgDf9fQpyG7IqrO4tbYMgNDHK7MAHNA FZAgQzGkc8omAaAlMJMtC0ggWIieQ9HPqVJFXYUId05EUUJQvthlq2ff2.JhLFdU8obb.lO.F06w _xvaA8vDFrHasaxyuXs6l0W1KAJctv553mmDOTJCjEe7xY4DjRIt0KmAPx1f8HAq5FSWp1aA5qDb MEJ_nQvhjfcZmMLFjzaXZFODQ1lkQaWQJ8FVuLPOH1HagncfBntB_6KF6ZkIZtZ3_yCC2esNlu8d oipvf2TTwAg7NXwLR8X6On9y0FaxYHIu5QslSP3_VrIkl04Luv4tUuGSktD4S1_x8LFuvdt2AY.Y ckXOr9QX1ghCBVT6F76DnlijaGhp7F1KdAczcnNSee Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.bf2.yahoo.com with HTTP; Mon, 16 Dec 2019 03:49:26 +0000 Original-Received: by smtp423.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 67e639ded9e8ca36d692d30aa887f65d; Mon, 16 Dec 2019 03:49:22 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83eex771ky.fsf@gnu.org> X-Mailer: WebService/1.1.14728 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.6.132.125 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:243402 Archived-At: Hi Eli: 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. 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); 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? On Sat, Dec 14, 2019 at 10:28:45AM +0200, Eli Zaretskii wrote: >Jimmy, > >The current code in extend_face_to_end_of_line says: > > /* Face extension extends the background and box of IT->extend_face_id > to the end of the line. If the background equals the background > of the frame, we don't have to do anything. */ > struct face *face = FACE_FROM_ID (f, (it->face_before_selective_p > ? it->saved_face_id > : extend_face_id)); > > if (FRAME_WINDOW_P (f) > && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) > && face->box == FACE_NO_BOX > && FACE_COLOR_TO_PIXEL (face->background, f) == FRAME_BACKGROUND_PIXEL (f) >#ifdef HAVE_WINDOW_SYSTEM > && !face->stipple >#endif > && !it->glyph_row->reversed_p > && !Vdisplay_fill_column_indicator) > return; > >This has the effect that the underline property is not extended past >EOL, and neither are overline and strike-through. Only the box >attribute is extended. Was this how we intended things to be, or is >this just an oversight? > >Currently, this creates some strange counter-intuitive effects. For >example, try this in "emacs -Q": > > C-p > M-x font-lock-mode RET > M-: (add-text-properties (point) (1+ (point)) '(face (:underline t :extend t))) RET > >You will see that the underline is limited only to the newline at >point, it is not extended to the edge of the window. But if you now >do this: > > C-SPC > C-n > >suddenly the entire last line is underlined, in addition to having the >background color from the region face. > >If you replace the :underline with :box in the above example, then the >last line has the box attribute extended to EOL even before setting >the region, as expected. > >So I think this is a bug, and we should add conditions to the above >'if' clause. Am I missing something? >