[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Code depending on hostname
From: |
weber |
Subject: |
Re: Code depending on hostname |
Date: |
Wed, 08 Aug 2007 11:04:12 -0700 |
User-agent: |
G2/1.0 |
On 8 ago, 14:31, Hadron <hadronqu...@googlemail.com> wrote:
> Could someone possibly advise me on some example lisp of how to do alternate
> things based on the hostname of the machine that the code is being run on?
>
> e.g.
>
> if hostname is A
> call funcA
> else if hostname is B
> call funcB
> else ....
>
> many thanks for any pointers.
If i understood you, you want something like this?
system-name is a variable defined in `C source code'.
Its value is "HSMOB"
Documentation:
The host name of the machine Emacs is running on.
So we can do something like this in our .emacs:
(if (string-equal system-name "HSMOB")
(hs-config-laptop)
(hs-config-work))
and then define functions for each configuration, like:
(defun hs-config-laptop ()
"Configuration for my laptop"
(h-color-theme-ocean-deep)
(setq ispell-program-name "aspell"))
Did this help you ?
Cheers,
weber