desktop-save-buffer is a variable defined in `desktop.el'.
Its value is

  • Automatically becomes buffer-local when set.

When non-nil, save buffer status in desktop file.

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