all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Merging the underline attribute at EOL
@ 2019-12-14  8:28 Eli Zaretskii
  2019-12-16  3:12 ` Ergus
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Eli Zaretskii @ 2019-12-14  8:28 UTC (permalink / raw)
  To: Ergus; +Cc: emacs-devel

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?



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-12-23 13:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-14  8:28 Merging the underline attribute at EOL Eli Zaretskii
2019-12-16  3:12 ` Ergus
2019-12-16 16:12   ` Eli Zaretskii
2019-12-16  3:49 ` Ergus
2019-12-16 16:17   ` Eli Zaretskii
2019-12-16 16:11 ` Ergus
2019-12-16 17:05   ` Eli Zaretskii
2019-12-16 20:31     ` Ergus
2019-12-17  3:22       ` Eli Zaretskii
2019-12-17 14:13         ` Ergus
2019-12-17 17:18           ` Eli Zaretskii
2019-12-19  1:19             ` Ergus
2019-12-19 15:38               ` Eli Zaretskii
2019-12-22 22:46                 ` Ergus
2019-12-23 13:35                   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.