The Revolver’s Notepad

Emacs configurations — basics

Posted in Quick References by Vincent on November 13, 2009

In this series of posts a step by step introduction of configuring Emacs to a proper working environment will be covered. The Emacs configuration files will be pasted and explained.

When Emacs is started, it reads the initialization file .emacs from some default directories. One of those is the HOME directory of the current user. Under Linux, it is the directory ~. Under Windows it is typically under what the HOME environment has specified, or check here for a detailed description (Section 3.5).

Essentially you can put everything in this .emacs file, but here in this post a more structured way is introduce for easy management of configurations for different uses of Emacs. The .emacs file simply looks like the following.

(add-to-list 'load-path "~/.emacs.d/site-lisp")
(mapc 'load (directory-files "~/.emacs.d" t "\\.el\\'"))

The first line specifies where Emacs should find configuration files or packages in addition to its defaults. The Emacs LISP jargon ‘mapc’ function loads every .el file in the .emacs.d directory under the HOME directory one by one, so you can put your different configuration files separate. When you want to disable anyone of them, just change their extension from .el to .el.bak then you are fine. Using the Emacs dired mode or the Emacs shell, this is can be done quite easily.

Advertisements
Tagged with: , ,

One Response

Subscribe to comments with RSS.

  1. […] After compiling and installing Maude, it may be helpful to set up Emacs so that experiment with Maude is easier. First download the Emacs Maude mode from SourceForge. Put it in your load path, and then add the following to a file maude.el under .emacs.d folder so that it is loaded by Emacs. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: