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
Message #127 received at 4543 <at> emacsbugs.donarmstrong.com (full text, mbox):
> I think the name is OK, but the docstring needs to clearly explain what
> is the intended behavior (which, I must say, I do not know, but I guess
> it's something like "the frame is not split top-down", except we're
> talking about a window). It's more important to make sure that
> the docstring is clear and describes a useful behavior, than to make
> sure it describes the actual behavior of its current implementation.
I could come up with something like
(defun window-full-height-p (&optional window)
"Return t if WINDOW is as high as the root window of its frame.
WINDOW defaults to the selected window.
This function returns t if and only if there is no other window
above WINDOW and there is either no other window below WINDOW or
the minibuffer window appears right below WINDOW."
(unless window
(setq window (selected-window)))
(= (window-height window)
(window-height (frame-root-window (window-frame window)))))
but maybe Glenn has a better idea.
>> 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;
>> }
>
> Seems reasonable. Where do you use it?
Most everywhere. There's no sense reasoning about fringes, margins or
scrollbars when reasoning about sizes of windows or frames. The only
function I could think of where counting text columns might have been
useful is `split-window' ...
martin
This bug report was last modified 15 years and 286 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.