[Top][All Lists]

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

Re: Machine-dependent elisp

From: Kevin Rodgers
Subject: Re: Machine-dependent elisp
Date: Tue, 27 Apr 2010 21:34:58 -0600
User-agent: Thunderbird (Macintosh/20100228)

Alex Bennee wrote:
On 21 April 2010 21:46,  <> wrote:
Hi all,

I have some code which I would like to make dependent on the machine I
am currently working on. I have a single .emacs shared between my work
machine and my home machine. I thought about making dependent on the ip
address (or hostname) but then I need a way to get the ip address (or
hostname) of my current machine.

I do exactly this with (system-name), e.g.:

(defvar I-am-at-work (string-match "workdomain" (system-name)))
(defvar I-am-at-home (string-match "danny" (system-name)))
(defvar I-am-on-netbook (string-match "trent" (system-name)))

And then later on in my .emacs I have stanzas like:

 ((eval I-am-on-netbook)

Nix the eval.

Kevin Rodgers
Denver, Colorado, USA

reply via email to

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