From: Stefan Monnier <monnier@iro.umontreal.ca>
To: martin rudalics <rudalics@gmx.at>
Cc: 4543@emacsbugs.donarmstrong.com
Subject: bug#4543: window-full-height-p
Date: Fri, 02 Oct 2009 09:30:29 -0400 [thread overview]
Message-ID: <jwvpr96ylnv.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <4AC5BC45.4060406@gmx.at> (martin rudalics's message of "Fri, 02 Oct 2009 10:39:33 +0200")
>>>> (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.
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.
> (3) It must be rewritten as soon as someone implements horizontal
> scrollbars ;-)
That's OK: this code is (now) available for 0 efforts, so rewriting it
wouldn't mean that much effort has been wasted.
> 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?
Stefan
next prev parent reply other threads:[~2009-10-02 13:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-24 3:28 bug#4543: window-full-height-p Glenn Morris
2009-09-24 7:04 ` martin rudalics
2009-09-25 6:18 ` Glenn Morris
2009-09-25 7:40 ` martin rudalics
2009-09-25 9:27 ` Eli Zaretskii
2009-09-25 12:59 ` martin rudalics
2009-09-25 13:38 ` Eli Zaretskii
2009-09-25 15:04 ` martin rudalics
2009-09-25 15:55 ` Eli Zaretskii
2009-09-25 19:05 ` martin rudalics
2009-09-25 20:16 ` Stefan Monnier
2009-09-26 9:45 ` martin rudalics
2009-09-25 14:37 ` Stefan Monnier
2009-09-26 9:45 ` martin rudalics
2009-09-26 11:28 ` Eli Zaretskii
2009-09-26 13:41 ` martin rudalics
2009-09-26 16:27 ` Eli Zaretskii
2009-09-26 19:01 ` martin rudalics
2009-09-26 20:17 ` Eli Zaretskii
2009-09-27 7:49 ` martin rudalics
2009-09-25 17:23 ` Glenn Morris
2009-09-25 19:05 ` martin rudalics
2009-09-25 20:10 ` Stefan Monnier
2009-10-02 7:12 ` Glenn Morris
2009-10-02 8:39 ` martin rudalics
2009-10-02 13:30 ` Stefan Monnier [this message]
2009-10-02 15:56 ` martin rudalics
2009-10-02 18:37 ` Glenn Morris
2009-10-03 8:20 ` martin rudalics
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvpr96ylnv.fsf-monnier+emacsbugreports@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=4543@emacsbugs.donarmstrong.com \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).