Habibullah’s posterous

So Easy.

I love how easy it is creating and maintaining a blog at Posterous.

Comments [0]

Change the default Home directory in Emacs on Windows

When you first install (rather extract) Emacs on Windows, your home directory, ~/, defaults to:
C:/Documents and Settings/Your Name/Application Data.

You may want to change this to some other convenient location. To do this, start by making a file called "site-start.el" in your emacs/site-lisp folder.

In it put this line:
(setenv "HOME" "whatever/your/desired/home/dir/is")

Move your .emacs customization file from the previous location to this new location and you are set.

Comments [0]

Errr..

<scratching head>

Comments [0]

How to change Emacs' default font on Windows

What bugged me the most about Emacs when I started with it was that there was no easy way to permanently change my default font. Options -> Set Font and then Options -> Save Options would save my choices just for the session.

Then I realised that I have to do something to my .emacs file. But I didn't know what. Or why! Or even where to find such a .emacs file.

Emacs is a very customizable editor, you can tweak it in many many many different ways to suit your needs. I won't go on more about why Emacs rocks, that's for another post someday.

This recipe is about changing the default Emacs font.


1) Start Emacs (d'oh). We first get the name of the font; the way Emacs sees it.

2) Press C-x C-b and select *scratch*

3) In the *scratch* buffer, type in:
(w32-select-font)
and at the end of the line press C-j

4) You will get a Font Selection Dialog. Select the font you want. Click OK.

5) You should see a string similar to this:
"-raster-Dina-normal-r-normal-normal-13-97-96-96-c-*-iso8859-1"
Instead of Dina you'll see the selected font.

6) Now we open up your .emacs file and put this in. Press C-x C-f

7) In the mini-buffer, type in:
~/.emacs

8) If you are a newbie, a blank buffer will open up as you don't have a .emacs file.

9) Type in:
(set-default-font )
The above line calls a function called set-default-font that needs to be given an argument.

10) In my case it will be:
(set-default-font "-raster-Dina-normal-r-normal-normal-13-97-96-96-c-*-iso8859-1")

11) Remember to close the parenthesis. Press C-x C-s to save.

12) Press C-x C-c to close Emacs. When you restart Emacs you will see your chosen font as the default font.

Read this if you want to know more about why fonts in Emacs are named the way they are.

Comments [0]

Font Wars

Don't tell me your programs are written in Courier New! Well..at least you got one thing right; you're using a monospaced font! I've seen people use Arial. Shudder. Not pretty.

An inordinate amount of time of time has been spent by programmers looking for the one perfect programming font - the one font that doesn't jar your sensibilities, soothes your eyes and makes code flow.

I like two.

The first is the short and sweet Dina.

The second is a mouthful, BitStream Vera Sans Mono.

Get the zip files and if you are using Windows XP, then unzip the fonts to:
C:\WINDOWS\Fonts

I find these two to be very good for programming. I prefer my fonts to be nice and sharp and hence I don't use Clear Type. Ofcourse YMMV.

Enjoy!

Comments [1]