From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Perry E. Metzger" Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Implement functions for measuring fonts and max chars per line Date: Sun, 18 Jan 2015 21:56:43 -0500 Message-ID: <20150118215643.6939487c@jabberwock.cb.piermont.com> References: <87k31j3g03.fsf@posteo.de> <87d27b2ugp.fsf@posteo.de> <87zjaeo7eg.fsf@posteo.de> <874mrp46ns.fsf@posteo.de> <20150117153839.0de5fa7b@jabberwock.cb.piermont.com> <83k30lywa4.fsf@gnu.org> <20150117172122.0ccfba34@jabberwock.cb.piermont.com> <83iog4zrd2.fsf@gnu.org> <20150117230858.361b5307@jabberwock.cb.piermont.com> <83h9voyu9m.fsf@gnu.org> <20150118172633.61609906@jabberwock.cb.piermont.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1421636221 5865 80.91.229.3 (19 Jan 2015 02:57:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2015 02:57:01 +0000 (UTC) Cc: Eli Zaretskii , malsburg@posteo.de, emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 19 03:57:00 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YD2WP-0002zy-Lm for ged-emacs-devel@m.gmane.org; Mon, 19 Jan 2015 03:56:57 +0100 Original-Received: from localhost ([::1]:35312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD2WO-0003Y2-UD for ged-emacs-devel@m.gmane.org; Sun, 18 Jan 2015 21:56:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD2WL-0003Xm-It for emacs-devel@gnu.org; Sun, 18 Jan 2015 21:56:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YD2WH-0000KE-8U for emacs-devel@gnu.org; Sun, 18 Jan 2015 21:56:53 -0500 Original-Received: from hacklheber.piermont.com ([166.84.7.14]:60699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD2WC-0000Gx-IZ; Sun, 18 Jan 2015 21:56:44 -0500 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id D015240A; Sun, 18 Jan 2015 21:56:43 -0500 (EST) Original-Received: from jabberwock.cb.piermont.com (jabberwock.cb.piermont.com [10.160.2.107]) by snark.cb.piermont.com (Postfix) with ESMTP id 8B8B62DEB4C; Sun, 18 Jan 2015 21:56:43 -0500 (EST) In-Reply-To: X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.25; x86_64-apple-darwin14.0.0) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 166.84.7.14 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181420 Archived-At: On Sun, 18 Jan 2015 16:38:01 -0800 (PST) Drew Adams wrote: > > What I want is to know (by calculation) what the maximum height, > > in lines, happens to be so I can shove that in for 'height in > > default-frame-alist. (There are other uses for such information of > > course, see above.) > > The max height in pixels is `x-display-pixel-height'. > > Divide that by the value returned by `frame-char-height' for your > frame, or by whatever character height you intend to use, if > you know it, to find the number of lines possible for the display. > > But that does not count the space needed for these things: > > 1. menu-bar - you can approximate this by > `(frame-parameter nil 'menu-bar-lines)'. > > 2. tool-bar - similar: `tool-bar-lines'. > > 3. height of the window-mgr title bar and bottom border. > > 4. any other window-mgr stuff that is outside Emacs's > visibility & control. > > So proceeding this way you need to do a little estimating, > especially wrt window-mgr stuff. I've played these games before, and it is a reasonable stop-gap for what I'm trying to do, at least much of the time. What would be nice would be the addition of a function that told one the true maximum number of lines possible for a frame on the given display, *or* if there was a non-integer value you could specify for the "height" component of the frame-alist that simply meant "as much as possible". (Both might actually be nice things to have.) -- Perry E. Metzger perry@piermont.com