From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#4543: window-full-height-p Date: Fri, 25 Sep 2009 16:38:54 +0300 Message-ID: <83my4jta8h.fsf@gnu.org> References: <4ABB19F5.50908@gmx.at> <4ABC73DB.1060308@gmx.at> <83vdj7tlup.fsf@gnu.org> <4ABCBEC7.70901@gmx.at> Reply-To: Eli Zaretskii , 4543@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1253886444 17990 80.91.229.12 (25 Sep 2009 13:47:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 13:47:24 +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 Sep 25 15:47:17 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 1MrB8m-0007uJ-Mo for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Sep 2009 15:47:17 +0200 Original-Received: from localhost ([127.0.0.1]:36937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrB8m-00052A-7Z for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Sep 2009 09:47:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrB8i-000525-9i for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2009 09:47:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrB8d-00051t-SP for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2009 09:47:12 -0400 Original-Received: from [199.232.76.173] (port=50216 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrB8d-00051q-ON for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2009 09:47:07 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43817) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MrB8d-0000x9-5z for bug-gnu-emacs@gnu.org; Fri, 25 Sep 2009 09:47:07 -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 n8PDl4uD030042; Fri, 25 Sep 2009 06:47:05 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8PDj3FI029564; Fri, 25 Sep 2009 06:45:03 -0700 Resent-Date: Fri, 25 Sep 2009 06:45:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Eli Zaretskii Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 25 Sep 2009 13:45:03 +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.125388606028989 (code B ref 4543); Fri, 25 Sep 2009 13:45:03 +0000 Original-Received: (at 4543) by emacsbugs.donarmstrong.com; 25 Sep 2009 13:41:00 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mtaout7.012.net.il (mtaout7.012.net.il [84.95.2.19]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8PDewMN028986 for <4543@emacsbugs.donarmstrong.com>; Fri, 25 Sep 2009 06:40:59 -0700 Original-Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KQJ007004MO6200@i-mtaout7.012.net.il> for 4543@emacsbugs.donarmstrong.com; Fri, 25 Sep 2009 16:40:52 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.70.48.81]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KQJ00FH34O33730@i-mtaout7.012.net.il>; Fri, 25 Sep 2009 16:40:52 +0300 (IDT) In-reply-to: <4ABCBEC7.70901@gmx.at> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 25 Sep 2009 09:47:12 -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:31501 Archived-At: > Date: Fri, 25 Sep 2009 14:59:51 +0200 > From: martin rudalics > CC: 4543@emacsbugs.donarmstrong.com, rgm@gnu.org > > It's merely how this is set in `change_frame_size_1' which does > > SET_FRAME_COLS (f, newwidth); > > where > > #define SET_FRAME_COLS(f, val) \ > (FRAME_COLS (f) = (val), \ > (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f))) > > and > > #define FRAME_TOTAL_COLS_ARG(f, width) \ > ((width) \ > + FRAME_SCROLL_BAR_COLS (f) \ > + FRAME_FRINGE_COLS (f)) > and > > #define FRAME_SCROLL_BAR_COLS(f) \ > (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \ > ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \ > : 0) > > etc ... Well, maybe I'm missing something, but this seems quite clear to me. SET_FRAME_COLS sets both f->text_cols and f->total_cols, the former counts the width of only the text area of the display, the latter counts the total frame area that includes the scroll bars and the fringe. Both the scroll bar and the fringe may be absent, the most trivial example is the text terminal display. > What are the scrollbars of a frame, I'm asking myself. If we > define a frame as a collection of windows and frame-width as the width > of the widest window in that frame, things are deceptively simple. But > the calculations sketched above are a little over my head. If a frame has scroll bars, they are all of the same size, so counting this on the frame level seems reasonable. > > What's wrong with this (taken from frame.c:frame-parameters) as the > > frame height: > > > > height = (f->new_text_lines ? f->new_text_lines : FRAME_LINES (f)); > > new_text_lines is for a pending size change and zero otherwise. You > probably mean text_lines I don't see any reason not to use new_text_lines as well: first, you will be consistent with frame-parameters (a Good Thing, IMO), and second, your code will work even if redisplay didn't yet kick in. > what are canonical characters? Each line on the display can have its own height, remember? For example, look at a single-window frame whose window displays an "*info*" buffer -- there are several lines that use a larger fonts, and take more screen estate than others. You don't want such a window to screw up window-height or frame-height, do you? So to get this right, Emacs measures these in units of canonical characters, which are characters from the frame's default font. I think the size of this canonical character is given by the font info, but I'm not sure. > > and then subtract from it the height of the minibuffer window? > > > > The C variable `minibuf_window' should give you the Lisp object that > > holds the minibuffer window, and its `total_lines' attribute should > > give you the height of that window. Or am I missing something? > > Then why not use the height of the frame-root-window directly? No need > to subtract one value from the other. Fine, if you can get this efficiently in C.