Variable: desktop-save-mode-hook

desktop-save-mode-hook is a customizable variable defined in desktop.el.gz.

Value

nil

Documentation

Hook run after entering or leaving desktop-save-mode(var)/desktop-save-mode(fun).

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in /usr/src/emacs/lisp/desktop.el.gz
;;;###autoload
(define-minor-mode desktop-save-mode
  "Toggle desktop saving (Desktop Save mode).

When Desktop Save mode is enabled, the state of Emacs is saved from
one session to another.  In particular, Emacs will save the desktop when
it exits (this may prompt you; see the option `desktop-save').  The next
time Emacs starts, if this mode is active it will restore the desktop.

To manually save the desktop at any time, use the command `\\[desktop-save]'.
To load it, use `\\[desktop-read]'.

Once a desktop file exists, Emacs will auto-save it according to the
option `desktop-auto-save-timeout'.

To see all the options you can set, browse the `desktop' customization group.

For further details, see info node `(emacs)Saving Emacs Sessions'."
  :global t
  :group 'desktop
  (if desktop-save-mode
      (desktop-auto-save-enable)
    (desktop-auto-save-disable)))