From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#4543: window-full-height-p Date: Fri, 02 Oct 2009 17:56:03 +0200 Message-ID: <4AC62293.6010403@gmx.at> References: <4ABB19F5.50908@gmx.at> <4AC5BC45.4060406@gmx.at> Reply-To: martin rudalics , 4543@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1254499850 26118 80.91.229.12 (2 Oct 2009 16:10:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2009 16:10:50 +0000 (UTC) Cc: 4543@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 02 18:10:43 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MtkiQ-0002nT-Eu for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 18:10:42 +0200 Original-Received: from localhost ([127.0.0.1]:33131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtkiP-0007UB-M1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 12:10:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mtkf5-0004C3-RM for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 12:07:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mtkf1-00049k-65 for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 12:07:15 -0400 Original-Received: from [199.232.76.173] (port=46859 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mtkf0-00049e-Sd for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 12:07:11 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42353) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mtkf0-00074u-9f for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 12:07:10 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n92G77VY016997; Fri, 2 Oct 2009 09:07:08 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n92G58dd016306; Fri, 2 Oct 2009 09:05:08 -0700 Resent-Date: Fri, 2 Oct 2009 09:05:08 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 02 Oct 2009 16:05:08 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4543 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4543-submit@emacsbugs.donarmstrong.com id=B4543.125449897314754 (code B ref 4543); Fri, 02 Oct 2009 16:05:08 +0000 Original-Received: (at 4543) by emacsbugs.donarmstrong.com; 2 Oct 2009 15:56:13 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n92FuAvh014751 for <4543@emacsbugs.donarmstrong.com>; Fri, 2 Oct 2009 08:56:12 -0700 Original-Received: (qmail invoked by alias); 02 Oct 2009 15:56:04 -0000 Original-Received: from 62-47-36-205.adsl.highway.telekom.at (EHLO [62.47.36.205]) [62.47.36.205] by mail.gmx.net (mp001) with SMTP; 02 Oct 2009 17:56:04 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/DVOZ1g0rD6HX6pB91vEkwRSrGxW6yJB7ULmyR3z pG9Izj0Vv+2A/R User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 02 Oct 2009 12:07:15 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31638 Archived-At: > 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