GNU bug report logs -
#4543
window-full-height-p
Previous Next
Reported by: Glenn Morris <rgm <at> gnu.org>
Date: Thu, 24 Sep 2009 03:50:04 UTC
Severity: wishlist
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>> (defun window-full-height-p (&optional window)
>>> (unless window
>>> (setq window (selected-window)))
>>> (= (window-height window)
>>> (window-height (frame-root-window (window-frame window)))))
>
> Please could this be installed?
I have a number of problems with this:
(1) The name is problematic. Note that `window-full-width-p' has no
such problem because when it returns t the window is as wide as the
containing frame.
(2) It might give unexpected results when invoked with the minibuffer
window as argument. Again `window-full-width-p' has no such problems.
(3) It must be rewritten as soon as someone implements horizontal
scrollbars ;-)
Currently, getting (and setting) the sizes of windows (or frames) is a
mess. Consider, for example, `split-window': If you use `window-width'
on its argument WINDOW in order to pre-calculate the SIZE argument you
almost certainly end up doing the wrong thing.
Personally, I use a function `window-size' to return the total size of a
window thus avoiding such confusions:
DEFUN ("window-size", Fwindow_size, Swindow_size, 0, 2, 0,
doc: /* Return total number of lines of WINDOW.
WINDOW defaults to the selected window. The return values includes any
header- or mode-line. Optional argument HORIZONTAL non-nil means return
total number of columns of WINDOW. In this case the return value
includes any scroll-bars of WINDOW. */)
(window, horizontal)
Lisp_Object window, horizontal;
{
if (!NILP (horizontal))
return decode_any_window (window)->total_cols;
else
return decode_any_window (window)->total_lines;
}
Anyway, if you can think of a better name (which should resolve (1) and
(2)) and a comment wrt (3) feel free to install it. I'm currently a bit
reluctant to install because my internet connection has been unreliable
over the past weeks.
martin
This bug report was last modified 15 years and 275 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.