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

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

RE: [h-e-w] Initialization help needed


From: Ricky Marek
Subject: RE: [h-e-w] Initialization help needed
Date: Mon, 10 Dec 2001 14:17:18 +0200

Hello,

I have solved this, by having a .emacs that is small, and used as a 
dispatcher to other startup (or init) files, which deppend on the version
of emacs. The startup file worked nice also on different platforms (Solaris,
SunOS, 
Linux, Windows) and different flavors of emacs (XEmacs, NTEmacs, etc.).

The good side of the coin, is that your .emacs become small, and the rest of
the
startup can be specific for a machine or emacs version (I use different
startup files
for every emacs flavor I use), and the specific part of your startup code
can be byte-compiled
speeding up your startup. (On some cases I had the .emacs also
byte-compiled)

The bad side of the code, is that you need to maintain all the startup
files. (If you change
one, you need to have the discipline to change also the others.)


I use the following environment variables for it: "HOME".  Which points to
the home directory,  (e.g. "D:\" under my WinNT machine.)

The specific startup files are always in the same file hierartchy :
~/lib/lisp
... an hierarchy that should exist on all platforms you run.

Here is my code:

;;
;; My private lisp directory
;; ~~~~~~~~~~~~~~~~~~~~~~~~~
;;   I have my private Lisp directory under ${HOME}/lib/lisp, that is
;;   the directory may be named as  "~/lib/lisp".

(setq my-lisp-dir   "~/lib/lisp")

;;
;; Pre-append to load-path the private-lisp-directory:
;;

(setq load-path
      (append (mapcar 'expand-file-name
                      (list my-lisp-dir))
              load-path))

;;
;; Which kind of Emacs are we using now?
;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;; - The conditional sttm will be filled for
;;   additional emacs versions if needed!
;;

(cond ((string-match "XEmacs" emacs-version)
             ;; We got here XEmacs
             (require 'my-xemacs-init))
      ((string-match "Lucid" emacs-version)
             ;; We got here Lucid or old XEmacs?
             (require 'my-lucid-init))
      ((equal window-system  'w32)
             ;; We got here NT/Emacs?
             (require 'my-nt-init))
      (t     
             ;; We got here the traditional fsf emacs on Unix.
             (require 'my-fsf-init)))


Hope that this helps you.


--- Ricky Marek                      -*- Mode: Another-Unix-Hacker -*-
----------------------------------------------------------------------
-   mailto:address@hidden           phone: +972-(04)-9937333 ext:123
-   http://www.waveip.com               fax: +972-(04)-9592614
-   ICQ# 4465370                     mobile: +972-(058)-629444
----------------------------------------------------------------------
- "I have learned to use the word 'impossible' with the 
-  greatest caution". -- Wernher von Braun




-----Original Message-----
From: Bingham, Jay [mailto:address@hidden
Sent: Wed, December 05, 2001 10:59 PM
To: Help-Emacs-Windows
Subject: [h-e-w] Initialization help needed


I am trying to modularize my init files so that I can have some small
files that contain items that wary from one system to another.  I have
run into a problem in attempting to do this on windows.  I want to put
the expressions that add my own directories to the load path into one of
these small files.  However I cannot figure out how to load the file.  I
have tried (load "$HOME/myfile.el") and (load "~/myfile.el").  In both
cases when I run the init file emacs has an error trying to load the
file it says it is trying to load "/myfile.el".  Neither $HOME nor ~ are
being expanded to C: at this point in the initialization.  If I try to
open a file using either of these aliases I get the same results.  If I
run an init file that does not try to open this file emacs starts
without error and if I try to open a file using those aliases they are
converted to c:.
The init file works without error in my UNIX environment.
It appears to me that the definition of these aliases for emacs in the
Windows environment does not occur until after the initialization is
complete. 
Can someone tell me why this is the case and if there is a way to get
around it.  It works this way in both emacs 20.4 and 21.1.

J_)
C_)ingham
.    COMPAQ NonStop Integrity Systems
.    Austin, TX
. Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire. -Dr. George W. Crane-




reply via email to

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