From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Phillip Lord Newsgroups: gmane.emacs.help Subject: Re: desktop height? Date: 28 Jan 2003 18:48:36 +0000 Organization: BIOSCI/MRC Human Genome Mapping Project Resource Centre 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 1043779856 26454 80.91.224.249 (28 Jan 2003 18:50:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 28 Jan 2003 18:50:56 +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 18daoG-0006p0-00 for ; Tue, 28 Jan 2003 19:50:12 +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 18daon-00041a-07 for gnu-help-gnu-emacs@m.gmane.org; Tue, 28 Jan 2003 13:50:45 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!server1.netnews.ja.net!hgmp.mrc.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 95 Original-NNTP-Posting-Host: bromine.hgmp.mrc.ac.uk Original-X-Trace: niobium.hgmp.mrc.ac.uk 1043779717 4031 193.62.192.35 (28 Jan 2003 18:48:37 GMT) Original-X-Complaints-To: news@net.bio.net Original-NNTP-Posting-Date: Tue, 28 Jan 2003 18:48:37 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93 Original-Xref: shelby.stanford.edu gnu.emacs.help:109506 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:6027 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6027 >>>>> "Bruce" == Bruce Ingalls writes: Bruce> Phillip Lord wrote: >> "Bruce" == Bruce Ingalls writes: Bruce> Does anyone know a way to calculate the height of the Bruce> >> desktop Bruce> in elisp? ... I used to probe the display to get what is Bruce> effectively a >> maximised emacs, on start up. I stopped doing this because >> probing in this way misses things like the Gnome toolbar (which I >> still want to be visible). In recent years I've just gone onto >> setting it by hand. Bruce> Send me your code! Well as I say, I set things up "by hand" now, so its not much use for you. As I generally use only a few machines, I do this.... (add-to-list 'load-path "~/emacs/machine-config") ;;this is the config file loading function (defun phil-load-config-for-machine(&optional suffix) "This function attempts to load machine specific configuration information. This information should be placed in a lisp file called NAME-suffix.el where NAME is the machine name, either fully qualified with the domain name, or not. If `suffix' is not given it defaults to -config. The variable `phil-display-is-local' will be set to true if the initial frame is opening on a local machine" (interactive) (let* ((suf (if suffix suffix "-config")) (machine-config-file-long (concat (system-name) suf)) (machine-config-file-short (concat (substring machine-config-file-long 0 (string-match "[.]" machine-config-file-long)) suf))) ;; this part of the function is essentially a total guess. I hope ;; it will work but I shall have to play with it a little if it doesnt (setq phil-display-is-x (boundp 'x-display-name)) (if phil-display-is-x (setq phil-display-is-local-x (equal x-display-name ":0")) (setq phil-display-is-local-x nil)) ;; load a file named after this machine, using the fully qualified name in preference first. (if (or (load machine-config-file-long 't) (load machine-config-file-short 't)) ;;try the default config therefore (load "default-machine-config" 't)))) which loads a file based on the machine name, which just then sets the size up by hand. It's less than perfect. In particular resizing the main emacs frame, causes it to pop up on which ever viewport is currently visible, so I normally have to move my emacs around to the correct viewport after it's started. Fortunately as I use sawfish, I can do this with a few key presses. Bruce> I already use `ps` to check for gnome-panel, kicker, and Bruce> others. I'm not sure how to detect a menu at the top of Bruce> Sawfish, but this has a manual override. Now this is a good idea. I shall have to have a look at your code. It would probably have been too much effort to do for myself. I have briefly toyed with the idea of interacting with sawfish, from within emacs, which might allow me to probe for the panel, and solve the viewport issue. But this is probably more effort than its worth, as getting values by hand when I use a new machine works well most of the time. Bruce> I'm using this for the EMacro project, where the point of its Bruce> ease of use, is to I guessed as much! Bruce> The EMacro philosophy is to use those smart, easy wizards to Bruce> set you up, then gets Bruce> out of the way, to tweak like a Unix hack, should that be Bruce> necessary. A good philosophy, I think. Cheers Phil