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

From: John Mastro <[email-masked]>
Date: Sat, 4 Jun 2016 14:37:28 -0700

Eli Zaretskii <[email-masked]> wrote:
>> Thanks for the response, Eli. If it's not a bug in terminal emacs,
>> then why do GUI emacs and terminal emacs display different things?
>> Note from the images that the empty space in GUI is _not_ given the
>> same overlay/face as the text.
>
> If you show me some Lisp which produces these different effects in X
> and non-X sessions, I could try looking for the reason.  All I've seen
> is a screenshot, from which I deduced (perhaps incorrectly) what was
> done to produce it.

Here's an example shows the effect Colin is seeing:

    (let (beg end ov)
      (defface example-underline-face
        '((t :underline t))
        "Example face with underlining")
      (goto-char (point-max))
      (newline)
      (setq beg (point))
      (insert "    foo\n    bar\n")
      (setq end (point))
      (setq ov (make-overlay beg end))
      (overlay-put ov 'face 'example-underline-face))

The result is the same with text properties instead of an overlay:

    (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.

        John