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: Sat, 17 Jan 2015 23:08:58 -0500 Message-ID: <20150117230858.361b5307@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> 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 1421554153 24303 80.91.229.3 (18 Jan 2015 04:09:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Jan 2015 04:09:13 +0000 (UTC) Cc: malsburg@posteo.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 18 05:09:13 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 1YChAm-0006Vb-Va for ged-emacs-devel@m.gmane.org; Sun, 18 Jan 2015 05:09:13 +0100 Original-Received: from localhost ([::1]:60841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YChAm-0000Ar-2l for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 23:09:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YChAi-0000Al-J0 for emacs-devel@gnu.org; Sat, 17 Jan 2015 23:09:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YChAe-0007Mb-8r for emacs-devel@gnu.org; Sat, 17 Jan 2015 23:09:08 -0500 Original-Received: from hacklheber.piermont.com ([166.84.7.14]:54902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YChAZ-0007Lx-J0; Sat, 17 Jan 2015 23:08:59 -0500 Original-Received: from snark.cb.piermont.com (localhost [127.0.0.1]) by hacklheber.piermont.com (Postfix) with ESMTP id 24781176; Sat, 17 Jan 2015 23:08:58 -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 A698F2DEB25; Sat, 17 Jan 2015 23:08:58 -0500 (EST) In-Reply-To: <83iog4zrd2.fsf@gnu.org> 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:181396 Archived-At: On Sun, 18 Jan 2015 05:42:49 +0200 Eli Zaretskii wrote: > > > > This all brings to mind: is there a good way now to determine > > > > what the maximum number of lines in a frame would be in a > > > > given font on the user's display? > > > > > > You mean window, not frame, right? > > > > No, frame. > > It's meaningless to ask this question about frames, since frames > don't display text, at least not in GUI sessions. There is a variables named default-frame-alist where I can do things like setting 'height to an integer like "55" which seems to indicate a frame where 55 lines of text may be viewed. Perhaps my terminology is screwed up because of "default-frame-alist" and the like, but my goal is to calculate what "55" should be rather than setting it through trial and error. Regardless, my .emacs currently includes (if window-system (add-to-list 'default-frame-alist (cons 'height 60))) and I'd like to compute which "height" is full height for my display (again, rather than simply figuring a number out by trial and error). > > I'd like to be able to set my default frame height to "full > > height" for the display (filling the display from top to bottom) > > -- right now I do guesswork to do this, and my .emacs breaks when > > I switch to a new display. > > Then you need to maximize the frame vertically. I'm unclear on how to do that programatically either. > > > See window-screen-lines, which I think does what you want. > > > > I believe that says how many lines are in an emacs window, not in > > the frame if it contains a single window > > When the frame has a single window, this says exactly what the frame > can display. Yes, but I want to set the height of the frame, not query what it is. I know what it is since I set it -- but I want to set it to the largest integer it can be given the display and the font I am using. Am I being unclear? Perry -- Perry E. Metzger perry@piermont.com