* window-body-height vs window-text-height
@ 2008-10-28 10:21 martin rudalics
2008-10-28 11:11 ` Miles Bader
0 siblings, 1 reply; 6+ messages in thread
From: martin rudalics @ 2008-10-28 10:21 UTC (permalink / raw)
To: emacs-devel
Can someone tell me the difference between `window-body-height' and
`window-text-height'? It seems a bit confusing having two function do
more or less the same thing - but maybe the partial-height lines make
the difference.
Thanks, martin.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: window-body-height vs window-text-height
2008-10-28 10:21 window-body-height vs window-text-height martin rudalics
@ 2008-10-28 11:11 ` Miles Bader
2008-10-28 12:37 ` martin rudalics
2008-10-28 14:12 ` Stefan Monnier
0 siblings, 2 replies; 6+ messages in thread
From: Miles Bader @ 2008-10-28 11:11 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-devel
martin rudalics <rudalics@gmx.at> writes:
> Can someone tell me the difference between `window-body-height' and
> `window-text-height'? It seems a bit confusing having two function do
> more or less the same thing - but maybe the partial-height lines make
> the difference.
If there is a partial line at the bottom of the window,
window-text-height rounds down, and window-body-height rounds up.
If there are no fractional lines, both return the same value.
[In both cases, the number of lines assumes the default face -- neither
measures what's actually displayed.]
-Miles
--
"I distrust a research person who is always obviously busy on a task."
--Robert Frosch, VP, GM Research
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: window-body-height vs window-text-height
2008-10-28 11:11 ` Miles Bader
@ 2008-10-28 12:37 ` martin rudalics
2008-10-28 15:11 ` Drew Adams
2008-10-28 14:12 ` Stefan Monnier
1 sibling, 1 reply; 6+ messages in thread
From: martin rudalics @ 2008-10-28 12:37 UTC (permalink / raw)
To: Miles Bader; +Cc: emacs-devel
> If there is a partial line at the bottom of the window,
> window-text-height rounds down, and window-body-height rounds up.
> If there are no fractional lines, both return the same value.
>
> [In both cases, the number of lines assumes the default face -- neither
> measures what's actually displayed.]
Aha. Thanks for this information.
martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: window-body-height vs window-text-height
2008-10-28 11:11 ` Miles Bader
2008-10-28 12:37 ` martin rudalics
@ 2008-10-28 14:12 ` Stefan Monnier
2008-10-28 15:22 ` Miles Bader
1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2008-10-28 14:12 UTC (permalink / raw)
To: Miles Bader; +Cc: martin rudalics, emacs-devel
>> Can someone tell me the difference between `window-body-height' and
>> `window-text-height'? It seems a bit confusing having two function do
>> more or less the same thing - but maybe the partial-height lines make
>> the difference.
> If there is a partial line at the bottom of the window,
> window-text-height rounds down, and window-body-height rounds up.
> If there are no fractional lines, both return the same value.
> [In both cases, the number of lines assumes the default face -- neither
> measures what's actually displayed.]
Now I'm confused. IIUC window sizes can only be multiples of the
default face size, so the number of lines (assuming the default face)
can only be a whole number and can never include partial lines, no?
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: window-body-height vs window-text-height
2008-10-28 12:37 ` martin rudalics
@ 2008-10-28 15:11 ` Drew Adams
0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2008-10-28 15:11 UTC (permalink / raw)
To: 'martin rudalics', 'Miles Bader'; +Cc: 'emacs-devel'
> > If there is a partial line at the bottom of the window,
> > window-text-height rounds down, and window-body-height rounds up.
> > If there are no fractional lines, both return the same value.
> >
> > [In both cases, the number of lines assumes the default
> > face -- neither measures what's actually displayed.]
>
> Aha. Thanks for this information.
Just wondering: Why not just one function, with an additional arg to indicate
the difference?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: window-body-height vs window-text-height
2008-10-28 14:12 ` Stefan Monnier
@ 2008-10-28 15:22 ` Miles Bader
0 siblings, 0 replies; 6+ messages in thread
From: Miles Bader @ 2008-10-28 15:22 UTC (permalink / raw)
To: Stefan Monnier; +Cc: martin rudalics, emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> If there is a partial line at the bottom of the window,
>> window-text-height rounds down, and window-body-height rounds up.
>> If there are no fractional lines, both return the same value.
>
>> [In both cases, the number of lines assumes the default face -- neither
>> measures what's actually displayed.]
>
> Now I'm confused. IIUC window sizes can only be multiples of the
> default face size, so the number of lines (assuming the default face)
> can only be a whole number and can never include partial lines, no?
But the numbers returned by those functions don't include the
mode-line/header-line -- and AFAIK, it's only true that the _total_
window height (including the mode-line/header-line) must be a multiple
of the default face height. If you use e.g. a mode-line which is taller
than a normal text line, you'll get a fractional last line in the text
display area.
-Miles
--
Marriage, n. The state or condition of a community consisting of a master, a
mistress and two slaves, making in all, two.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-10-28 15:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28 10:21 window-body-height vs window-text-height martin rudalics
2008-10-28 11:11 ` Miles Bader
2008-10-28 12:37 ` martin rudalics
2008-10-28 15:11 ` Drew Adams
2008-10-28 14:12 ` Stefan Monnier
2008-10-28 15:22 ` Miles Bader
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.