Tuesday, December 14, 2010

Finding Emacs - The Window is a Frame and the Frame is a Window

Emacs was written before Microsoft Windows came on the scene, so the terminology is different.  Consider when you first fire up Emacs.  There is one window looking at you with a menu bar and toolbar at the top.

Weeelllll .. almost.

The outer border is a FRAME.  Inside that is one WINDOW.  You can have several divisions inside a frame, each of which is called a window.  You can play with this with the File menu.  Select new Frame.  Split the window, and remove the splits.

Now for Buffy ... er ... Buffers.


  • The term "buffer" is effectively a file in memory.  
  • You can choose from the list of buffers to show one in a window using the buffer menu  and you can look at the same buffer in any number of windows.  
  • You can open or close a buffer from the File menu.  
  • One final twist.  If you are playing a game, or using one of the associated programs from within Emacs, that program is a buffer.  
  • You can close it using the File-Close menu selection, or select another to use from the Buffer menu.



Easy ... er ... yes ....


Later.

Finding Emacs - the Growing Links List

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.




Monday, December 13, 2010

Finding Emacs - Why?

 v 0.3
Updated 12 Oct 11


A sometime series I thought I'd post as I work out how to use this amazing piece of software.

At first blush, you look at Emacs and think:

  • "Hey, it is only an editor - what can the fuss be?  There are heaps of editors out there that do great stuff, and are easier to use to boot!"
  • Then you hear more, about the wars with Vim and then the extensibility or something.
  • And then you find out about Orgmode and discover that many people only come to Emacs because of this.  And then they are lost forever.


Why is Emacs Different?

Emacs is different because at its heart, it is a Lisp interpreter around which all the routines are built.  It is putty and it is extensible to do whatever you want.  Start using it as an editor, then discover the calculator, the calendar and then the games.  Use orgmode for outlines, agendas and then export to latex.  Discover the newsreader, email client and then the web-browser.

Perhaps a tour is in order.


Which Computers will it Run on?


What system do you use?  You can download and run Emacs on pretty much any platform you can think of.  If you run Unix or Linux then you probably already have Emacs included - at least in the Terminal, if not on the desktop.

Emacs for Windows
Emacs for OSX
Aquamacs for OSX


Investment in the Future

Learn Emacs and you have it for life.  Doesn't sound like much, but the more you invest in learning to use Emacs, the richer your long-term rewards.  It can do so much that replaces those one-off programs you buy and use for a while.  Emacs can stay with you no matter which computer you buy in the future.  It will always be there to get you out of that hole.

Update 12 Oct 11

It's been a year since I wrote this, and can only say that it understates the case for Emacs.  As I've learnt how to manipulate this piece of software, I can only say that the effort has been well worth it.

Learn Emacs and its tools, such as Orgmode and you will have a highly capable authoring and organising tool that you can use on any computer for as long as you wish.


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


more later ......