Subject: bug#23574: 24.5; Overzealous underlining in emacs-nox

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Jun 2016 18:54:20 +0300

> From: John Mastro <[email-masked]>
> Date: Sat, 4 Jun 2016 14:37:28 -0700
> Cc: Eli Zaretskii <[email-masked]>, Colin Woodbury <[email-masked]>
> 
>     (progn
>       (defface example-underline-face
>         '((t :underline t))
>         "Example face with underlining")
>       (goto-char (point-max))
>       (newline)
>       (insert (propertize "    foo\n    bar\n"
>                           'font-lock-face
>                           'example-underline-face)))
> 
> In a graphical frame, the underline only extends one character past the
> visible text (this one extra character presumably being the newline).
> However, in a text frame the underline extends all the way to the end of
> the window.

OK, then my guess was correct after all, and what you see is how Emacs
behaved since v21 at least.  If there is a problem here, it's in GUI
frames, not in TTY frames.  We always try to make the empty space
after the end of a screen line have the same face as the last
character of that line.  With background color, this works in both TTY
and GUI frames, but we cannot do that with underlining without
actually drawing something in that empty space.  While it should be
possible to have GUI frames display underline all the way to window
edge, no one has ever requested that, so we didn't bother.

In sum, this is the intended behavior, and if the application doesn't
like it, it should refrain from underlining more than one line.