From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: [PATCH] Implement functions for measuring fonts and max chars per line Date: Sun, 18 Jan 2015 16:38:01 -0800 (PST) Message-ID: 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: quoted-printable X-Trace: ger.gmane.org 1421627919 15162 80.91.229.3 (19 Jan 2015 00:38:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2015 00:38:39 +0000 (UTC) Cc: malsburg@posteo.de, emacs-devel@gnu.org To: "Perry E. Metzger" , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 19 01:38:35 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 1YD0MT-000873-FF for ged-emacs-devel@m.gmane.org; Mon, 19 Jan 2015 01:38:33 +0100 Original-Received: from localhost ([::1]:35116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD0MS-0002Zf-NZ for ged-emacs-devel@m.gmane.org; Sun, 18 Jan 2015 19:38:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD0ME-0002ZY-T3 for emacs-devel@gnu.org; Sun, 18 Jan 2015 19:38:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YD0MD-00087h-Jm for emacs-devel@gnu.org; Sun, 18 Jan 2015 19:38:18 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:35683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD0M7-00085z-FB; Sun, 18 Jan 2015 19:38:11 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t0J0c9mG023767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Jan 2015 00:38:10 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0J0c5PZ015367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 19 Jan 2015 00:38:07 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t0J0c59r021907; Mon, 19 Jan 2015 00:38:05 GMT In-Reply-To: <20150118172633.61609906@jabberwock.cb.piermont.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:181416 Archived-At: > 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=20 `(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.