From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Chris McMahan Newsgroups: gmane.emacs.help Subject: Re: desktop height? Date: 31 Jan 2003 08:48:52 -0500 Organization: Posted via Supernews, http://www.supernews.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044021117 19301 80.91.224.249 (31 Jan 2003 13:51:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 31 Jan 2003 13:51:57 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18ebZf-0004zK-00 for ; Fri, 31 Jan 2003 14:51:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18ebZD-0007rz-02 for gnu-help-gnu-emacs@m.gmane.org; Fri, 31 Jan 2003 08:50:51 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-X-Complaints-To: abuse@supernews.com Original-Lines: 83 Original-Xref: shelby.stanford.edu gnu.emacs.help:109638 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6154 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6154 Thanks! Your suggestion on the name changes is excellent. I'll make that change here as well. As for setting MY_FONT, here's the code (with some more context around it): ;;;=================================================== ;;; Set the default font and frame size for all frames ;;;=================================================== (defconst MY_FONT "-*-Lucida Console-normal-r-*-*-11-*-*-*-c-*-iso8859-15") ;;; Set the default font to return the appropriate character height ;;; for the initial height calculation (set-frame-font MY_FONT) ;;; initial window position settings, height and vertical position is ;;; automatically calculated from within the .emacs-config file ;;; The top left corner is 0 0, the bottom right is -1 -1 (defconst MY_INITIAL_WIDTH 120) (defconst MY_INITIAL_LEFT -15) The reason I do it with the consts is that I place all of the settings (email, proxy, directory locations and such) within my .emacs file, then call a .emacs-config file from there to do the actual configurations based on the settings. - Chris Bruce Ingalls writes: > Chris McMahan wrote: > > Bruce Ingalls writes: > >>Does anyone know a way to calculate the height of the desktop in elisp? > ... > > I've got the following code with sets the initial height based on the > > current screen's resolution (working under WindowsXP with Emacs 21.2). > > This assumes the font (defined in my .emacs as MY_FONT) is already > > set. This is necessary to correctly return the frame-char-height. > Would be nice to see the syntax to set MY_FONT > > ...> ;;; frame sizing functions > ...> (defun fix-frame () > ... > Very nice. Worked on my Linux box, which makes me believe that your code is > more portable. I did need to adjust it for the > tray/panel/taskbar/statusbar, as > > you indicated. > > Consider renaming your functions, so that you can more easily remember them > with sentence completion, and so that they better fit a name space. > Instead of fix-frame, etc. try: > frame-adjust > frame-fix > frame-enlarge > > While your code worked perfectly for Emacs, I had to adjust XEmacs. I > also do this > > (already) in desktop-height-approx(). > > I'd like to hear from the community, as to which code works better for them. > I remind users to adjust for their XEmacs & taskbars, when using your > code, before > > making judgement. > > One last tradeoff with your code: the use of set-frame-height() is > nice, in that it > > can change an already running Emacs, but, as opposed to > frame-initial-frame-plist() > > or setq default-frame-plist(), it appears to be capable to screw up an > emacs -nw > > and perhaps other console modes of Emacs/XEmacs. > -- (. .) =ooO=(_)=Ooo======================== Chris McMahan | cmcmahan-AT-one.net ====================================