help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: desktop height?


From: Phillip Lord
Subject: Re: desktop height?
Date: 28 Jan 2003 18:48:36 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.93

>>>>> "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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]