+ "Regexp identifying files whose buffers are to be excluded from saving."
+ :type 'regexp
+ :group 'desktop)
+
+;; We skip TAGS files to save time (tags-file-name is saved instead).
+(defcustom desktop-modes-not-to-save
+ '(tags-table-mode)
+ "List of major modes whose buffers should not be saved."
+ :type '(repeat symbol)
+ :group 'desktop)
+
+(defcustom desktop-file-name-format 'absolute
+ "*Format in which desktop file names should be saved.
+Possible values are:
+ absolute -- Absolute file name.
+ tilde -- Relative to ~.
+ local -- Relative to directory of desktop file."
+ :type '(choice (const absolute) (const tilde) (const local))
+ :group 'desktop
+ :version "22.1")
+
+(defcustom desktop-restore-eager t
+ "Number of buffers to restore immediately.
+Remaining buffers are restored lazily (when Emacs is idle).
+If value is t, all buffers are restored immediately."
+ :type '(choice (const t) integer)
+ :group 'desktop
+ :version "22.1")
+
+(defcustom desktop-lazy-verbose t
+ "Verbose reporting of lazily created buffers."
+ :type 'boolean
+ :group 'desktop
+ :version "22.1")
+
+(defcustom desktop-lazy-idle-delay 5
+ "Idle delay before starting to create buffers.
+See `desktop-restore-eager'."
+ :type 'integer
+ :group 'desktop
+ :version "22.1")
+
+;;;###autoload
+(defvar desktop-save-buffer nil
+ "When non-nil, save buffer status in desktop file.
+This variable becomes buffer local when set.
+
+If the value is a function, it is called by `desktop-save' with argument
+DESKTOP-DIRNAME to obtain auxiliary information to save in the desktop
+file along with the state of the buffer for which it was called.
+
+When file names are returned, they should be formatted using the call
+\"(desktop-file-name FILE-NAME DESKTOP-DIRNAME)\".
+
+Later, when `desktop-read' evaluates the desktop file, auxiliary information
+is passed as the argument DESKTOP-BUFFER-MISC to functions in
+`desktop-buffer-mode-handlers'.")
+(make-variable-buffer-local 'desktop-save-buffer)
+(make-obsolete-variable 'desktop-buffer-modes-to-save
+ 'desktop-save-buffer "22.1")
+(make-obsolete-variable 'desktop-buffer-misc-functions
+ 'desktop-save-buffer "22.1")
+
+;;;###autoload
+(defvar desktop-buffer-mode-handlers
+ nil
+ "Alist of major mode specific functions to restore a desktop buffer.
+Functions listed are called by `desktop-create-buffer' when `desktop-read'
+evaluates the desktop file. List elements must have the form
+
+ (MAJOR-MODE . RESTORE-BUFFER-FUNCTION).
+
+Buffers with a major mode not specified here, are restored by the default
+handler `desktop-restore-file-buffer'.
+
+Handlers are called with argument list
+
+ (DESKTOP-BUFFER-FILE-NAME DESKTOP-BUFFER-NAME DESKTOP-BUFFER-MISC)
+
+Furthermore, they may use the following variables:
+
+ desktop-file-version
+ desktop-buffer-major-mode
+ desktop-buffer-minor-modes
+ desktop-buffer-point
+ desktop-buffer-mark
+ desktop-buffer-read-only
+ desktop-buffer-locals
+
+If a handler returns a buffer, then the saved mode settings
+and variable values for that buffer are copied into it.
+
+Modules that define a major mode that needs a special handler should contain
+code like
+
+ (defun foo-restore-desktop-buffer
+ ...
+ (add-to-list 'desktop-buffer-mode-handlers
+ '(foo-mode . foo-restore-desktop-buffer))
+
+Furthermore the major mode function must be autoloaded.")
+
+;;;###autoload
+(put 'desktop-buffer-mode-handlers 'risky-local-variable t)
+(make-obsolete-variable 'desktop-buffer-handlers
+ 'desktop-buffer-mode-handlers "22.1")
+
+(defcustom desktop-minor-mode-table
+ '((auto-fill-function auto-fill-mode)
+ (vc-mode nil)
+ (vc-dired-mode nil))
+ "Table mapping minor mode variables to minor mode functions.
+Each entry has the form (NAME RESTORE-FUNCTION).
+NAME is the name of the buffer-local variable indicating that the minor
+mode is active. RESTORE-FUNCTION is the function to activate the minor mode.
+called. RESTORE-FUNCTION nil means don't try to restore the minor mode.
+Only minor modes for which the name of the buffer-local variable
+and the name of the minor mode function are different have to be added to
+this table. See also `desktop-minor-mode-handlers'."
+ :type 'sexp
+ :group 'desktop)
+
+;;;###autoload
+(defvar desktop-minor-mode-handlers
+ nil
+ "Alist of functions to restore non-standard minor modes.
+Functions are called by `desktop-create-buffer' to restore minor modes.
+List elements must have the form
+
+ (MINOR-MODE . RESTORE-FUNCTION).
+
+Minor modes not specified here, are restored by the standard minor mode
+function.
+
+Handlers are called with argument list
+
+ (DESKTOP-BUFFER-LOCALS)
+
+Furthermore, they may use the following variables:
+
+ desktop-file-version
+ desktop-buffer-file-name
+ desktop-buffer-name
+ desktop-buffer-major-mode
+ desktop-buffer-minor-modes
+ desktop-buffer-point
+ desktop-buffer-mark
+ desktop-buffer-read-only
+ desktop-buffer-misc
+
+When a handler is called, the buffer has been created and the major mode has
+been set, but local variables listed in desktop-buffer-locals has not yet been
+created and set.
+
+Modules that define a minor mode that needs a special handler should contain
+code like
+
+ (defun foo-desktop-restore
+ ...
+ (add-to-list 'desktop-minor-mode-handlers
+ '(foo-mode . foo-desktop-restore))
+
+Furthermore the minor mode function must be autoloaded.
+
+See also `desktop-minor-mode-table'.")
+
+;;;###autoload
+(put 'desktop-minor-mode-handlers 'risky-local-variable t)
+