the length set
to the size of the screen where I'm working. I had a function that
calculated the maximum length (max-lines) that I could use for the
window.
This is what I would do:
(/
(x-display-pixel-height) (frame-char-height))
That gives you the max height in number of lines, which
is what you want, if I understand correctly.