[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
window-height function lies! (was: How to know the value of a non intera
From: |
Rodolfo Medina |
Subject: |
window-height function lies! (was: How to know the value of a non interactive function?) |
Date: |
Wed, 01 Oct 2008 17:58:51 +0100 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.50 (gnu/linux) |
Rodolfo Medina <rodolfo.medina@gmail.com> writes:
>> Pardon the basicness of my question: I wish to know what value is
>> returned by the `window-height' function in my buffer: how can I
>> achieve that?
Anders Wirzenius <anders@no.email.thanks.invalid> writes:
> type
> (window-height)
> in the buffer and press C-xC-e
Peter Dyballa <Peter_Dyballa@Web.DE> writes:
> Or in the *scratch* buffer, and only there, C-j.
Tassilo Horn <tassilo@member.fsf.org> writes:
> With `M-:' you can evaluate arbitrary lisp code which has access to the
> current environment (buffer with point and mark, window, etc.) where you
> hit `M-:'. So in your case
>
> M-: (window-height)
>
> should do the trick.
Thanks to Anders, Peter and Tassilo for their help.
But, the remarkable result is that, the value returned by window-height turns
to be *false* when the buffer contains a line longer that the screen width (a
line that continues on the following line). Besides, window-height fails in
info buffers and TeX mode buffers, that contain chapter and node titles with
bigger characters.
This is probably related to the malfunction of the
`scroll-preserve-screen-position' variable and of all lisp codes (pager.el,
scroll-in-place.el, etc.) that want to keep point `in place' when scrolling
(see my thread on the matter).
The problem seems to me to be quite a serious one. Comments (and possible
solutions) welcome upon this matter.
Thanks
Rodolfo