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

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

Re: how to keep .emacs files in synch


From: Andreas Röhler
Subject: Re: how to keep .emacs files in synch
Date: Thu, 4 Oct 2007 11:24:22 +0200
User-agent: KMail/1.8.2

Am Mittwoch, 3. Oktober 2007 21:30 schrieb Andrew Walrond:
> kj wrote:
> > I regularly work on various systems, and it's a bit of a chore to
> > keep my .emacs files in synch.  I've tried various approaches, none
> > entirely satisfactory.  The two issues that give me the most
> > headaches are 1) to automate the process whereby changes to one
> > system's .emacs file gets reflected on the .emacs files on other
> > systems; and 2) to manage those modifications that are applicable
> > to only one or a subset of the systems.
> >
> > I'd be interested to read how others solve this problem.
>
> Well, I would use one .emacs on all systems, but include some COND stuff
> to let the .emacs decide which parts are appropriate for the current
> system.
>

....

Yeah. Here maybe some examples for this

Solved it in my ~/.emacs file that way:

(cond ((string-match "XEmacs\\|Lucid" emacs-version)
       (when (file-readable-p "~/.xemacs/init.el")
         (load "~/.xemacs/init.el" nil t)))
      ((or (string-match "22" (emacs-version))
           (string-match "23" (emacs-version)))
       (if
           (file-readable-p "~/.gnu-emacs-cvs-custom")
           (progn (load "~/.gnu-emacs-cvs-custom" t t)

...

      ((string-match "21.4" (emacs-version))
       (if 
           (file-readable-p "~/.gnu-emacs-custom")
           (progn (load "~/.gnu-emacs-custom" t t)
...
      (t (message "%s" "No Emacs init file found"))) 


Extendable with

(when (string-match "my-host" (getenv "HOST")))

for example.


Andreas Röhler





reply via email to

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