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: Merging the underline attribute at EOL Date: Sat, 14 Dec 2019 10:28:45 +0200 Message-ID: <83eex771ky.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="98842"; 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 Sat Dec 14 09:29:05 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 1ig2nR-000Pb8-Ea for ged-emacs-devel@m.gmane.org; Sat, 14 Dec 2019 09:29:05 +0100 Original-Received: from localhost ([::1]:57236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ig2nP-0000Bb-Oh for ged-emacs-devel@m.gmane.org; Sat, 14 Dec 2019 03:29:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52095) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ig2nI-0000BR-Ey for emacs-devel@gnu.org; Sat, 14 Dec 2019 03:28:57 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ig2nI-0002FT-3X; Sat, 14 Dec 2019 03:28:56 -0500 Original-Received: from [176.228.60.248] (port=2246 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ig2nG-0005il-K9; Sat, 14 Dec 2019 03:28:55 -0500 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:243374 Archived-At: 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?