From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4543: window-full-height-p Date: Fri, 02 Oct 2009 09:30:29 -0400 Message-ID: References: <4ABB19F5.50908@gmx.at> <4AC5BC45.4060406@gmx.at> Reply-To: Stefan Monnier , 4543@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1254491272 29176 80.91.229.12 (2 Oct 2009 13:47:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Oct 2009 13:47:52 +0000 (UTC) Cc: 4543@emacsbugs.donarmstrong.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 02 15:47:44 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 1MtiU3-0003uY-3r for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 15:47:43 +0200 Original-Received: from localhost ([127.0.0.1]:49593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtiU2-0007c9-KF for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Oct 2009 09:47:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtiTc-0007RI-J4 for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 09:47:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtiTX-0007OD-NQ for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 09:47:16 -0400 Original-Received: from [199.232.76.173] (port=37143 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtiTX-0007Ny-Gm for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 09:47:11 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:57626) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MtiTW-000824-Cd for bug-gnu-emacs@gnu.org; Fri, 02 Oct 2009 09:47: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 n92Dl7b5026399; Fri, 2 Oct 2009 06:47:07 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n92DZ4CW024201; Fri, 2 Oct 2009 06:35:04 -0700 Resent-Date: Fri, 2 Oct 2009 06:35:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 02 Oct 2009 13:35:04 +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.125449023824045 (code B ref 4543); Fri, 02 Oct 2009 13:35:04 +0000 Original-Received: (at 4543) by emacsbugs.donarmstrong.com; 2 Oct 2009 13:30:38 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n92DUaBt024037 for <4543@emacsbugs.donarmstrong.com>; Fri, 2 Oct 2009 06:30:38 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsAEADadxUpFxIJG/2dsb2JhbACBUdYShCwEhx0 X-IronPort-AV: E=Sophos;i="4.44,494,1249272000"; d="scan'208";a="46984509" Original-Received: from 69-196-130-70.dsl.teksavvy.com (HELO pastel.home) ([69.196.130.70]) by ironport2-out.pppoe.ca with ESMTP; 02 Oct 2009 09:30:30 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id DA3E08109; Fri, 2 Oct 2009 09:30:29 -0400 (EDT) In-Reply-To: <4AC5BC45.4060406@gmx.at> (martin rudalics's message of "Fri, 02 Oct 2009 10:39:33 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 02 Oct 2009 09:47:16 -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:31635 Archived-At: >>>> (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