desktop-buffer-mode-handlers
desktop-buffer-mode-handlers is a variable defined in `
desktop.el
'.
Its value is shown
below.
- This variable may be risky if used as a file-local variable.
Documentation:
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.
Value:
((mh-folder-mode . mh-restore-desktop-buffer)
(vc-dir-mode . vc-dir-restore-desktop-buffer)
(todo-mode . todo-restore-desktop-buffer)
(rmail-mode . rmail-restore-desktop-buffer)
(eww-mode . eww-restore-desktop)
(doc-view-mode . doc-view-restore-desktop-buffer)
(dired-mode . dired-restore-desktop-buffer)
(Info-mode . Info-restore-desktop-buffer))