Function: desktop-load-file
desktop-load-file is a byte-compiled function defined in
desktop.el.gz.
Signature
(desktop-load-file FUNCTION)
Documentation
Load the file where auto loaded FUNCTION is defined.
If FUNCTION is not currently defined, guess the library that defines it and try to load that.
Source Code
;; Defined in /usr/src/emacs/lisp/desktop.el.gz
(defun desktop-load-file (function)
"Load the file where auto loaded FUNCTION is defined.
If FUNCTION is not currently defined, guess the library that defines it
and try to load that."
(if (fboundp function)
(autoload-do-load (symbol-function function) function)
;; Guess that foobar-mode is defined in foobar.
;; TODO rather than guessing or requiring an autoload, the desktop
;; file should record the name of the library.
(let ((name (symbol-name function)))
(if (string-match "\\`\\(.*\\)-mode\\'" name)
(with-demoted-errors "Require error in desktop-load-file: %S"
(require (intern (match-string 1 name)) nil t))))))