\subsection{A sample {\it .emacs\_init.el} file:}

A superset of this file can be found in {\it
/mit/sipb/pro\-to\-type/sipb.emacs}.

\begin{verbatim}

;;; Mostly snarfed from Robert Krawitz (rlk@think.com)

(setq inhibit-startup-message t)        ; I've already read it

;;; This variable controls the appearance of the mode line.
;;; It is a reasonably complicated example of formatting
;;; specifications.  Do C-h v on mode-line-format to find
;;; out more information.

(setq my-system-name (system-name))
(setq-default mode-line-format 
              '("-%1*%1*-" my-system-name ": " (buffer-file-name "%f" "%b")
                " " global-mode-string " %[(" mode-name minor-mode-alist
                mode-line-process ")%]--" (-3 . "%p") "-%-"))


(setq mode-line-format default-mode-line-format)

;;; Random customization

(setq startup-major-mode 'text-mode)

(setq default-major-mode 'text-mode)

(setq display-time-day-and-date t)

(display-time)

;;; Function courtesy of Jim Fulton
;;; This one is bound to M-h under 'setting keys'

(defun my-kill-help-window ()
  "Kill off the stupid help window."
  (interactive)
  (delete-windows-on "*Help*"))

;;; Miscellaneous rmail variables
;;; (also see the rmail section)

(setq mail-self-blind t)

(setq rmail-delete-after-output t)

(setq rmail-file-name (expand-file-name "~/Mail/RMAIL"))

;;; File Handling

;;; These all customize the internal operations of the
;;; editor.  If you wish to find out what these do, you
;;; should read the documentation on the variables.

(setq auto-mode-alist
      (append '(("\\.txt$" . text-mode))
        auto-mode-alist))

(setq backup-before-writing t)

(setq backup-by-copying-when-linked t)

(setq delete-auto-save-files t)

(setq require-final-newline t)

(setq make-backup-files nil)

;;; Courtesy of Bill Sommerfeld (wesommer@athena)
;;; See /mit/sipb/prototype/sipb.emacs for tab
;;; modifications in c-mode.

(setq c-indent-level 8
      c-argdecl-indent 8
      comment-column 40
      c-label-offset -8
      c-continued-statement-indent 0
      c-continued-statement-offset 8
      c-auto-newline nil
      c-brace-offset 8)

;;; Define some hooks (mode customizing functions). Note
;;; that defun will not work (use lambda) because defun
;;; shoves code into function slot of atom, while setq
;;; shoves into value slot. All modes check the value slot
;;; for hooks.  Alternatively, you can use (setq <mode name>
;;; (defun <mode name> ...)) but this is wasteful.

;;; These are typical hooks that you would want to set up to
;;; handle specific modes.

(setq text-mode-hook
      (function (lambda ()
                  (setq fill-column 72)
                  (auto-fill-mode 1))))

;;; A reasonably complicated example of a hook being used to
;;; customize a major mode. This inserts some random
;;; headers, and places the cursor in the To: field.  It
;;; will be called whenever a piece of mail is being
;;; initialized.

(setq mail-setup-hook
      (function (lambda ()
                  (save-excursion
                    (if to
                        (forward-line -1)
                      (forward-line 2))
                    (insert
                      "Reply-To: " (user-login-name) "@athena.mit.edu\n"
                      "Full-Name: " (user-full-name) "\n"
                      "Address:       W20-557, 84 Mass Ave.\n"
                      "               Cambridge, MA  02139\n")))))

;;; Setting keys

;;; C-h gets you help, and M-h kills it.  Sounds mnemonic
;;; to me.  M-h is initally bound to mark-paragraph, but
;;; I find myself killing help windows a lot more often than
;;; I mark paragraphs.  Just be aware that you're nuking a
;;; default binding.

(define-key esc-map "h" 'my-kill-help-window)

;;; Make rmail quicker to use (this nukes the binding of
;;; copy-rectangle-to-register)

(define-key ctl-x-map "r" 'rmail)

\end{verbatim}
