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

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

Re: [h-e-w] .emacs file(s) for multiple versions of Emacs on Windows


From: David J. Biesack
Subject: Re: [h-e-w] .emacs file(s) for multiple versions of Emacs on Windows
Date: Tue, 22 May 2012 12:46:39 -0400

> Is there some way to have the different versions initialize
> themselves from different .emacs files?

I use the following in my ~/.emacs:

(defun optional-load-library (name)
  "Optionally load a library from a NAME. If NAME is null, do nothing."
  (when name
    (setq name (downcase name))
    (condition-case err
        (and (file-exists-p (concat (getenv "HOME") "/emacs/" name ".el"))
             (load-library name)
             (message "loaded optional library %s" name))
      (error (message err)))))

  (optional-load-library (format "my-emacs%d" emacs-major-version)) ;; 
my-emacs21.el or my-emacs22.el my-emacs23.el

and put version-specific elisp in each of those files (i.e. my-emacs23.el )

I do something similar for window-system and even specific hosts:

  (optional-load-library (symbol-name window-system)) ;; w32.el or win32.el or 
x.el
  (optional-load-library (symbol-name system-type))
  (optional-load-library (or (getenv "HOSTNAME") (getenv "HOST") (getenv 
"COMPUTERNAME")))

djb

-- 
David J. Biesack | Principal API Architect | SAS
@davidbiesack | 919-531-7771 | www.sas.com




reply via email to

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