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

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

Re: Machine-dependent elisp


From: Steve Revilak
Subject: Re: Machine-dependent elisp
Date: Fri, 23 Apr 2010 21:32:46 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

From: address@hidden

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.

Any suggestions on the best way to do this?

(I don't think it matters but the code I need to change is mostly the
loading of certain libraries and the setting of the smtp server for
gnus)


I can offer one possible solution.
I use the same ~/.emacs on several machines, but there are slight
differences in the way that each machine is configured.  To give a
concrete example, I'd like to use "ant -find build.xml" as the default
compile command at work, and "make" as the default compile command at
home.

To achieve this, my ~/.emacs has

  (if (file-exists-p "~/.elisp/machine-local.el")
(load "~/.elisp/machine-local.el"))
machine-local.el has the machine-specific settings.

The Emacs manual has a similar example, which uses custom-file.

  
http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Customizations.html#Saving-Customizations

Steve

Attachment: pgpo2hjxAIyoj.pgp
Description: PGP signature


reply via email to

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