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

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

Re: how to edit+compile+debug without leaving GNU/Emacs


From: N. Raghavendra
Subject: Re: how to edit+compile+debug without leaving GNU/Emacs
Date: Mon, 20 Feb 2006 17:00:21 +0530
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (berkeley-unix)

At 2006-02-20T00:28:06-08:00, venk wrote:

> How can I load different .emacs depending on the machine name?

One way is to create one init file named after each host, e.g.,
`edit.el', `build.el', and `debug.el', say in the directory
$HOME/emacs.  Then, use $HOME/.emacs as a wrapper which loads the
relevant init file.  So, `.emacs' would just contain the forms

(defun hostname (domain-name)
  "Return the hostname component of DOMAIN-NAME."
  (if (string-match "\\..*" domain-name)
      (replace-match "" t nil domain-name)
    domain-name))

(load (expand-file-name (hostname system-name) "~/emacs"))

HTH,
Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | See message headers for contact
Harish-Chandra Research Institute   | and OpenPGP details.


reply via email to

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