home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / help-lucid-emacs / text0002.txt < prev    next >
Encoding:
Text File  |  1993-07-14  |  2.0 KB  |  82 lines

  1.  
  2. Here's what I use...  Can't remember where it came from...
  3. It invokes ".emacs.lucid" when I'm running lucid emacs
  4. and .emacs.epoch when I'm running epoch:
  5.  
  6. ------
  7.  
  8.  
  9. ;;
  10. ;; This general purpose .emacs file will determine which version
  11. ;; of emacs is actually running, and load the corresponding
  12. ;; emacs startup file.
  13. ;;
  14. (defvar iam-emacs-version nil
  15.   "Describes the type of emacs which is running.
  16. 'emacs-ascii - GNU emacs 18.x on ascii terminal or xterm
  17. 'emacs-vt    - GNU emacs 18.x on VTxxx terminal
  18. 'emacs-sun   - GNU emacs 18.x in shelltool or commandtool
  19. 'lucid       - Lucid Emacs 19.x
  20. 'emacstool   - GNU 18.x for suntools
  21. 'epoch       - some epoch version
  22. 'xemacs      - GNU 18.x for X11 ")
  23.  
  24. (setq iam-emacs-version
  25.       (cond
  26.        ;; Epoch ?
  27.        ( (boundp 'epoch::version)
  28.      'epoch
  29.      )
  30.        ;; Lucid emacs ?
  31.        ( (and (eq window-system 'x)
  32.           (not (eq (string-match "^19.[0-9]+ Lucid" emacs-version) nil)))
  33.     'lucid
  34.     )
  35.        ;; emacs-vt ?
  36.        ( (and (eq window-system nil)
  37.           (eq (string-match "^vt.*" (getenv "TERM")) 0))
  38.      'emacs-vt
  39.      )
  40.        ;; emacs-ascii ?
  41.        ( (and (eq window-system nil)
  42.           (not(eq (getenv "WINDOW_TTYPARMS") nil))
  43.           (not (string-match "^sun.*" (getenv "TERM"))))
  44.      'emacs-ascii
  45.      )
  46.        ;; emacs-sun ?
  47.        ( (and (eq window-system nil)
  48.           (string= (getenv "WINDOW_TTYPARMS") "")
  49.           (not (eq (string-match "^sun.*" (getenv "TERM")) nil)))
  50.      'emacs-sun
  51.      )
  52.        ;; emacstool started from suntools?
  53.        ( (and (not(eq window-system 'x))
  54.           (equal (getenv "WINDOW_TTYPARMS") nil)
  55.           (string= (getenv "TERM") "sun"))
  56.      'emacstool
  57.      )
  58.        ;; xemacs ?
  59.        ( (and (eq window-system 'x)
  60.           (not (boundp 'epoch::version)))
  61.      'xemacs
  62.      )
  63.        ;; if all else fails, it's probably a emacs-sun
  64.        ( t
  65.      'emacs-sun
  66.      )
  67.        )
  68. ); iam-emacs-version
  69.  
  70. ;;
  71. ;; Now load the proper emacs startup file
  72. ;;
  73. (cond
  74.  ( (eq iam-emacs-version 'lucid)
  75.    (load (concat (getenv"HOME" 1) "/.emacs.lucid"))
  76.    )
  77.  ( (eq iam-emacs-version 'epoch)
  78.    (load ".emacs.epoch")
  79.    )
  80. )
  81.  
  82.