Subject: Re: bug#14825: 24.3.50; split-window-below miscounts window lines

From: Eli Zaretskii <[email-masked]>
Date: Sat, 13 Jul 2013 17:38:31 +0300

> Date: Sat, 13 Jul 2013 15:56:50 +0200
> From: martin rudalics <[email-masked]>
> CC: [email-masked]
> 
>  >> What is "the actual number of text lines in a window"?
>  >
>  > The number of glyph rows visible in the window.
> 
> So this is something that changes with the text displayed in the window
> and not only when changing the buffer's default face.

No, it doesn't.  I meant the number of lines of the default face.

> Also, would we then have four different units to measure window heights
> - frame lines, pixels, buffer lines, displayed lines?

Only 3, not 4.

>  >>  > Which is why we don't need to bother that it will become unreliable,
>  >>  > as it is already there.
>  >>
>  >> You mean it's not reliable currently?
>  >
>  > Yes.
> 
> In what sense?

In the sense that we have been discussing for the last several
months.  I don't think I need to repeat all that.

> I obviously agree because I consider it wrong when changing a
> frame's default face can affect its size but I suppose what you have
> in mind is something different.

If we agree, we don't have to talk about this aspect any more.

>  > Well, you now have window-screen-lines ;-)
> 
> I haven't looked at it yet.  Where is it?

In simple.el.  If you want to move it to window.el, I won't mind.

> Does it accept arbitrary buffer start and end points?

It measures in units of the default-face lines, so it doesn't care
about where in the buffer are you.

> Does it return pixel sizes?

No, line sizes.

>  >> and what I wrote `window-text-pixel-size' for.  But this is based
>  >> on actual line heights, not necessarily those specified by the buffer's
>  >> default face plus line spacing.  And I suppose moving by lines calls for
>  >> actual line heights too.
>  >
>  > Yes, of course.  If you need to count in units of the default face and
>  > also take the line-spacing into consideration, window-screen-lines is
>  > your friend.
> 
> So we should call `window-screen-lines' before splitting a window?

Probably.