unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 37641@debbugs.gnu.org
Subject: bug#37641: major/minor tick faces bleed into empty lines at the end of buffer
Date: Tue, 8 Oct 2019 11:37:04 +0200	[thread overview]
Message-ID: <CAAeL0SSUO8uMooGWnEdmsa02KphsXQnzHCUyGf55O0iGi59UUA@mail.gmail.com> (raw)
In-Reply-To: <83sgo3y632.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2752 bytes --]

  On Tue, Oct 8, 2019 at 10:50 AM Eli Zaretskii <eliz@gnu.org> wrote:

> Sorry, I don't think I understand what the images show me.  They seem
> identical.  Which face bleeds and where?  Please point out what should
> I be looking at to understand the difference.

In both images, the line numbered 19 is the last line in the buffer.

In the it_eob image, the "line" past the end of the buffer has an empty
number,
drawn with the major-tick face (but obviously without number). The rest of
non-lines,
until the end of the buffer, have their empty number drawn in the
line-number face.

In the beyond_zv image, the empty line after the end of the buffer is in the
line-number face, as all the other past that point. I think that's the
right behavior.

There's no reason for the line after the end of the buffer to be drawn with
the
major-tick face, even if it would be a major-tick line if it existed. It's
ugly.

> Did you try to arrange for the last line to be a multiple of one of
> the ticks as well?

In my examples? Yes, that's the whole point of the test: knowing what
happens when
the line after EOB would match a tick line number.

>  Also, what happens if you use the beyond_zv test
> in all the conditions

That's what I've done in the second patch I sent (applied after the first
one, not
alone). In my simple tests, everything works as expected.

> or use the it->what test in all the conditions?

I didn't try that, but as the first check (that uses it->what) is trying to
decide
whether to draw with the current-line-number, I don't think it is relevant
to
the problem I was trying to fix. It is relevant for consistency, of course.

> IOW, I don't understand why we need two different conditions regarding
> EOB for displaying a number with different faces.  What am I missing?

I don't know why (or if) the it->what check is necessary, instead of
beyond_zv.
I *know* that the other conditions (the ones affecting the choosing of tick
faces)
need beyond_zv, at least to get what I think is the right behavior (the one
in the
beyond_zv image). As said, I think that in fact it the first check can be
safely
replaced by !beyond_zv.

> You could simply start with
>
>   tem_it.face_id = lnum_face_id;
>
> and then have a series of tests for replacing that with another face
> ID; it would at least save you the 'else' clause.

Yes, good idea. Thanks.

> What does "between digits" mean?  While producing the glyphs for the
> digits of a single line number, no faces can change, because no Lisp
> is invoked.  Is that what you meant?

Yes, thanks. I expected as much, but the way the original code was written,
and
redisplay being notoriously tricky and an arcane art best left to wizards, I
though I was missing something (I'm not joking).

[-- Attachment #2: Type: text/html, Size: 3159 bytes --]

  reply	other threads:[~2019-10-08  9:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07  1:04 bug#37641: major/minor tick faces bleed into empty lines at the end of buffer Juanma Barranquero
2019-10-07  3:42 ` Juanma Barranquero
2019-10-07 16:17   ` Eli Zaretskii
2019-10-08  2:38     ` Juanma Barranquero
2019-10-08  4:23       ` Juanma Barranquero
2019-10-08  8:51         ` Eli Zaretskii
2019-10-08  8:49       ` Eli Zaretskii
2019-10-08  9:37         ` Juanma Barranquero [this message]
2019-10-08 10:47           ` Juanma Barranquero
2019-10-09 10:22             ` Eli Zaretskii
2019-10-09 10:39               ` Juanma Barranquero

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=CAAeL0SSUO8uMooGWnEdmsa02KphsXQnzHCUyGf55O0iGi59UUA@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=37641@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).