+;; Special handling.
+;; -----------------
+;; Variables `desktop-buffer-mode-handlers' and `desktop-minor-mode-handlers'
+;; are supplied to handle special major and minor modes respectively.
+;; `desktop-buffer-mode-handlers' is an alist of major mode specific functions
+;; to restore a desktop buffer. Elements must have the form
+;;
+;; (MAJOR-MODE . RESTORE-BUFFER-FUNCTION).
+;;
+;; Functions listed are called by `desktop-create-buffer' when `desktop-read'
+;; evaluates the desktop file. Buffers with a major mode not specified here,
+;; are restored by the default handler `desktop-restore-file-buffer'.
+;; `desktop-minor-mode-handlers' is an alist of functions to restore
+;; non-standard minor modes. Elements must have the form
+;;
+;; (MINOR-MODE . RESTORE-FUNCTION).
+;;
+;; Functions are called by `desktop-create-buffer' to restore minor modes.
+;; Minor modes not specified here, are restored by the standard minor mode
+;; function. If you write a module that defines a major or minor mode that
+;; needs a special handler, then place code like
+
+;; (defun foo-restore-desktop-buffer
+;; ...
+;; (add-to-list 'desktop-buffer-mode-handlers
+;; '(foo-mode . foo-restore-desktop-buffer))
+
+;; or
+
+;; (defun bar-desktop-restore
+;; ...
+;; (add-to-list 'desktop-minor-mode-handlers
+;; '(bar-mode . bar-desktop-restore))
+
+;; in the module itself, and make shure that the mode function is
+;; autoloaded. See the docstrings of `desktop-buffer-mode-handlers' and
+;; `desktop-minor-mode-handlers' for more info.
+
+;; Minor modes.
+;; ------------
+;; Conventional minor modes (see node "Minor Mode Conventions" in the elisp
+;; manual) are handled in the following way:
+;; When `desktop-save' saves the state of a buffer to the desktop file, it
+;; saves as `desktop-minor-modes' the list of names of those variables in
+;; `minor-mode-alist' that have a non-nil value.
+;; When `desktop-create' restores the buffer, each of the symbols in
+;; `desktop-minor-modes' is called as function with parameter 1.
+;; The variables `desktop-minor-mode-table' and `desktop-minor-mode-handlers'
+;; are used to handle non-conventional minor modes. `desktop-save' uses
+;; `desktop-minor-mode-table' to map minor mode variables to minor mode
+;; functions before writing `desktop-minor-modes'. If a minor mode has a
+;; variable name that is different form its function name, an entry
+
+;; (NAME RESTORE-FUNCTION)
+
+;; should be added to `desktop-minor-mode-table'. If a minor mode should not
+;; be restored, RESTORE-FUNCTION should be set to nil. `desktop-create' uses
+;; `desktop-minor-mode-handlers' to lookup minor modes that needs a restore
+;; function different from the usual minor mode function.
+;; ---------------------------------------------------------------------------