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.

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


Buffers with a major mode not specified here, are restored by the default
handler `desktop-restore-file-buffer'.

Handlers are called with argument list


Furthermore, they may use the following variables:


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.


((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))