On Tue, Oct 8, 2019 at 10:50 AM Eli Zaretskii 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).