Tuesday, December 14, 2010

Finding Emacs - Installation

 v 0.3
12 Oct 11

(Note - see updated post dated Oct 11)

There are probably three questions that come to mind when installing Emacs:
  • Where does the program go?
  • Where is "Home" on this platform?
  • How is the Emacs initialisation / configuration file organised?


Where does the program go?

OSX and Linux have this pretty well sorted out and it is only on Windows that you have to make a decision.  Of course "Program files" is the obvious first choice, however since Emacs is normally distributed for Windows as the straight binary with no installer, I tend to put it (and other such programs) in a " C:\pro " directory, so that the path becomes "C:\pro\emacs " .



Where is  "Home" ?

Home is pretty obvious when you think about it - except for Windows.  So where is it in Windows?  Depends.

For Windows XP it is "C:\Documents and Settings\username
For Windows Vista and 7 it is "C:\Users\username

where username  represents whatever your username for your account is.

..... but wait!

For Windows XP at least, when you have a look at the environment variables, THERE IS NO HOME!  The variable is called HOMEPATH - not much use to Emacs.  So, make an environmental variable "HOME" to make things to your liking, and this is what I have done.

Should you want to set your "HOME", in Control Panel, go to System>Advanced>Environment Variables>User variables.


How is the Emacs initialisation / configuration file organised?

Conventional positioning now is that the Emacs init file is in " ~\.emacs.d\init.el ".  Aquamacs has a different position in preferences - " ~/Library/Preferences/Aquamacs Emacs/Preferences.el " where, whilst it will understand the traditional init file, it will use Preferences.el if it can.

A significant advantage of using the " .emacs.d " directory is that you can put other emacs related files and directories in it and use it all from one place.

Some notes on Unix nomenclature.
  • The " ~ " character at the front of a pathname refers to the " home " directory.
  • A dot at the beginning of a file or directory name will hide that item in Unix.
  • Directories in Unix often have a " .d " at the end to distinguish them from files.  So " .emacs.d " is a hidden directory, whilst " .emacs " is a hidden file and " emacs " is a visible file.

Update 25 Dec 10

Clarifying for Windows XP - I make my "HOME" as "C:\home" - this makes it easy for me to sort things as my machine is a single user machine - if there are several accounts, then the homepath given above may well be the better way to go.

..... later

disclaimer - this worked for me, it may not work for you.




No comments:

Post a Comment