unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 23574@debbugs.gnu.org, john.b.mastro@gmail.com, cwoodbury@azavea.com
Subject: bug#23574: 24.5; Overzealous underlining in emacs-nox
Date: Mon, 06 Jun 2016 18:04:16 +0300	[thread overview]
Message-ID: <83h9d6tl3j.fsf@gnu.org> (raw)
In-Reply-To: <CAM-tV-8PMUorUvW21ah0V4OUTpXkedZrni6YmbhdHLoAJyKYug@mail.gmail.com> (message from Noam Postavsky on Mon, 6 Jun 2016 07:42:37 -0400)

> From: Noam Postavsky <npostavs@users.sourceforge.net>
> Date: Mon, 6 Jun 2016 07:42:37 -0400
> Cc: John Mastro <john.b.mastro@gmail.com>, 23574@debbugs.gnu.org, cwoodbury@azavea.com
> 
> > When the newline does not have the underline attribute, the underline
> > is not contiguous, so you are radically changing the use case.
> 
> Yes. However, I believe that this is what the original ensime code
> intended to do; it only underlines the newlines themselves because
> it's easier to make 1 overlay for all the lines at once and the
> programmer didn't notice it was wrong because it happens to give the
> desired effect in GUI mode.

I don't see how the effect on GUI frames could be considered
"desired".  What about the fact that the underline extends one space
beyond the line's text?  So on GUI frames we see the same problem,
just of smaller dimensions.  Or am I missing something?

> Regardless, by experimentation I find that the space at the edge of
> the screen takes the face from the final newline, not the last
> displayed glyph character in the line. Is this documented anywhere?

That space at the edge of the line is not a space at all, although it
looks like one.  It is a special glyph produced by the display engine,
primarily so that we could display the cursor at the end of the line.
Its attributes are invented by the display engine out of thin air for
its own purposes; for example, the buffer position recorded in that
glyph is zero, not the position of the newline.

As for your conclusion, I believe there's a misunderstanding here.
You are talking about the face of a buffer position, while I was
talking about the glyphs on the screen.  Other that this minor
disconnect, I don't see any contradiction between what we say.

Also note that the display engine doesn't examine each character's
face when it produces glyphs for display, it only examines the faces
where they change.  Which in this case means that the face of the
newline is immaterial; what matters is whether it is identical to that
of preceding characters.  To be precise, the face used for extension
is the one loaded into the iterator object when it hits the end of the
line.  As there are too many ways to specify faces in Emacs, I won't
risk confirming that your conclusion is 100% correct ;-)  My
description is correct, but perhaps less useful to a Lisp programmer.

As for documentation: these all are fine details of the display engine
that are not documented anywhere except in the code comments.  Even
the face extension itself isn't mentioned anywhere, I believe simply
because the effect is natural and expected, whereas its accurate
documentation is not simple at all.  Does it really make sense to
document just this specific subtlety?

IOW, if you are interested in these details, you should be hacking the
display engine code long ago ;-)

Going back to the bug report, there's still one issue to consider:
should we add underline (and then also overline and strikethrough) to
the list of face attributes that cause face extension on GUI frames.
The logic behind the current code seems to be to extend attributes
that are related to background of the text.  The above 3 seem to be a
kind-of background, so maybe we should add them.





  reply	other threads:[~2016-06-06 15:04 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 17:03 bug#23574: 24.5; Overzealous underlining in emacs-nox Colin Woodbury
2016-05-30 15:04 ` Colin Woodbury
2016-06-04  7:48   ` Eli Zaretskii
     [not found]     ` <CAHuwsfihHJ8WHwmHvMDF7Ynns4YOJSKEEbjhpbYrw0V=5aYXEQ@mail.gmail.com>
2016-06-04 16:20       ` Eli Zaretskii
2016-06-04 21:37         ` John Mastro
2016-06-05 15:54           ` Eli Zaretskii
2016-06-05 17:05             ` Noam Postavsky
2016-06-05 17:56               ` Eli Zaretskii
2016-06-05 18:20                 ` Colin Woodbury
2016-06-05 18:36                   ` Eli Zaretskii
2016-06-05 19:13                 ` Noam Postavsky
2016-06-06  2:27                   ` Eli Zaretskii
2016-06-06 11:42                     ` Noam Postavsky
2016-06-06 15:04                       ` Eli Zaretskii [this message]
2016-06-06 16:54                         ` martin rudalics
2016-06-06 18:25                           ` Colin Woodbury
2016-06-06 19:18                             ` Eli Zaretskii
2016-06-07  0:18                               ` Noam Postavsky
2016-06-07 15:55                                 ` Eli Zaretskii
2016-06-08  2:52                                   ` Noam Postavsky
2016-06-06 18:55                           ` Eli Zaretskii
2016-06-07  9:10                             ` martin rudalics
2016-06-07 15:50                               ` Eli Zaretskii
2016-06-08  6:33                                 ` martin rudalics
2016-06-08 17:05                                   ` Eli Zaretskii
2016-06-09  8:38                                     ` martin rudalics
2016-06-09 12:26                                       ` Eli Zaretskii
2016-06-10  7:16                                         ` martin rudalics
2016-06-10  8:10                                           ` Eli Zaretskii
2016-06-10  8:24                                             ` martin rudalics
2016-06-10  9:50                                               ` Eli Zaretskii
2016-06-10 13:59                                                 ` martin rudalics
2016-06-10 14:24                                                   ` Eli Zaretskii
2019-10-21 11:49 ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-08  5:32   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h9d6tl3j.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23574@debbugs.gnu.org \
    --cc=cwoodbury@azavea.com \
    --cc=john.b.mastro@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).