www.delorie.com/gnu/docs/emacs-lisp-intro/emacs-lisp-intro_237.html   search  
Buy the book!

Programming in Emacs Lisp

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

16.3 Beginning a `.emacs' File

When you start Emacs, it loads your `.emacs' file unless you tell it not to by specifying `-q' on the command line. (The emacs -q command gives you a plain, out-of-the-box Emacs.)

A `.emacs' file contains Lisp expressions. Often, these are no more than expressions to set values; sometimes they are function definitions.

See section `The Init File `~/.emacs'' in The GNU Emacs Manual, for a short description of initialization files.

This chapter goes over some of the same ground, but is a walk among extracts from a complete, long-used `.emacs' file--my own.

The first part of the file consists of comments: reminders to myself. By now, of course, I remember these things, but when I started, I did not.

;;;; Bob's .emacs file
; Robert J. Chassell
; 26 September 1985

Look at that date! I started this file a long time ago. I have been adding to it ever since.

; Each section in this file is introduced by a
; line beginning with four semicolons; and each
; entry is introduced by a line beginning with
; three semicolons.

This describes the usual conventions for comments in Emacs Lisp. Everything on a line that follows a semicolon is a comment. Two, three, and four semicolons are used as section and subsection markers. (See section `Comments' in The GNU Emacs Lisp Reference Manual, for more about comments.)

;;;; The Help Key
; Control-h is the help key;
; after typing control-h, type a letter to
; indicate the subject about which you want help.
; For an explanation of the help facility,
; type control-h two times in a row.

Just remember: type C-h two times for help.

; To find out about any mode, type control-h m
; while in that mode.  For example, to find out
; about mail mode, enter mail mode and then type
; control-h m.

`Mode help', as I call this, is very helpful. Usually, it tells you all you need to know.

Of course, you don't need to include comments like these in your `.emacs' file. I included them in mine because I kept forgetting about Mode help or the conventions for comments--but I was able to remember to look here to remind myself.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003