From: Phillip Lord <p.lord@russet.org.uk>
Subject: Re: desktop height?
Date: 28 Jan 2003 18:48:36 +0000 [thread overview]
Message-ID: <vfu1ftnm9n.fsf@rpc71.cs.man.ac.uk> (raw)
In-Reply-To: J0AZ9.55797$Oj7.11845179@twister.nyc.rr.com
>>>>> "Bruce" == Bruce Ingalls <bingalls@CUT-this-SPAM-BLOCK.fit-zones.com> writes:
Bruce> Phillip Lord wrote:
>> "Bruce" == Bruce Ingalls <bingalls.NO_SPAM@fit-zones.com> 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
next prev parent reply other threads:[~2003-01-28 18:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-28 6:47 desktop height? Bruce Ingalls
2003-01-28 14:27 ` Phillip Lord
2003-01-28 18:32 ` Bruce Ingalls
2003-01-28 18:48 ` Phillip Lord [this message]
2003-01-28 21:09 ` Bruce Ingalls
2003-01-31 8:07 ` Lee Sau Dan
2003-01-30 14:40 ` Chris McMahan
2003-01-31 0:11 ` Bruce Ingalls
2003-01-31 13:48 ` Chris McMahan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vfu1ftnm9n.fsf@rpc71.cs.man.ac.uk \
--to=p.lord@russet.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).