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

17. Save Buffer/Window Configuration Between Sessions

This package of functions gives Emacs the ability to remember which files were being visited, the windows that were on them, and the value of point in their buffers the last Emacs session in the same directory. This is an emulation of an old Gosling Emacs feature.

The relevant commands are save-context and recover-context.

Most of the time you'll want an Emacs session's context saved even if you choose not to recover it later. To avoid having to manually M-x save-context at each emacs exit, put the line:

  (setq auto-save-and-recover-context t)

in your initialization file or in `default.el' in the lisp directory of the Emacs distribution. The context will then automatically be saved when Emacs exits.

By default only the contexts of visible buffers (buffers with windows on them) are saved. Setting the variable save-buffer-context to t causes the contexts of all buffers to be saved.

To use the package put these lines

  (require 'saveconf)
  (if (null (cdr command-line-args))
      (setq inihibit-startup-message (recover-context)))

at the end of your initialization file or the `default.el' file in the lisp directory of the Emacs distribution. This causes the context saved in the current directory to be recovered whenever Emacs is invoked without any arguments.

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

This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html