home *** CD-ROM | disk | FTP | other *** search
-
- Here's what I use... Can't remember where it came from...
- It invokes ".emacs.lucid" when I'm running lucid emacs
- and .emacs.epoch when I'm running epoch:
-
- ------
-
-
- ;;
- ;; This general purpose .emacs file will determine which version
- ;; of emacs is actually running, and load the corresponding
- ;; emacs startup file.
- ;;
- (defvar iam-emacs-version nil
- "Describes the type of emacs which is running.
- 'emacs-ascii - GNU emacs 18.x on ascii terminal or xterm
- 'emacs-vt - GNU emacs 18.x on VTxxx terminal
- 'emacs-sun - GNU emacs 18.x in shelltool or commandtool
- 'lucid - Lucid Emacs 19.x
- 'emacstool - GNU 18.x for suntools
- 'epoch - some epoch version
- 'xemacs - GNU 18.x for X11 ")
-
- (setq iam-emacs-version
- (cond
- ;; Epoch ?
- ( (boundp 'epoch::version)
- 'epoch
- )
- ;; Lucid emacs ?
- ( (and (eq window-system 'x)
- (not (eq (string-match "^19.[0-9]+ Lucid" emacs-version) nil)))
- 'lucid
- )
- ;; emacs-vt ?
- ( (and (eq window-system nil)
- (eq (string-match "^vt.*" (getenv "TERM")) 0))
- 'emacs-vt
- )
- ;; emacs-ascii ?
- ( (and (eq window-system nil)
- (not(eq (getenv "WINDOW_TTYPARMS") nil))
- (not (string-match "^sun.*" (getenv "TERM"))))
- 'emacs-ascii
- )
- ;; emacs-sun ?
- ( (and (eq window-system nil)
- (string= (getenv "WINDOW_TTYPARMS") "")
- (not (eq (string-match "^sun.*" (getenv "TERM")) nil)))
- 'emacs-sun
- )
- ;; emacstool started from suntools?
- ( (and (not(eq window-system 'x))
- (equal (getenv "WINDOW_TTYPARMS") nil)
- (string= (getenv "TERM") "sun"))
- 'emacstool
- )
- ;; xemacs ?
- ( (and (eq window-system 'x)
- (not (boundp 'epoch::version)))
- 'xemacs
- )
- ;; if all else fails, it's probably a emacs-sun
- ( t
- 'emacs-sun
- )
- )
- ); iam-emacs-version
-
- ;;
- ;; Now load the proper emacs startup file
- ;;
- (cond
- ( (eq iam-emacs-version 'lucid)
- (load (concat (getenv"HOME" 1) "/.emacs.lucid"))
- )
- ( (eq iam-emacs-version 'epoch)
- (load ".emacs.epoch")
- )
- )
-
-