X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/31ca4639ad1bfaa355a3f30ef92eb977bd2c6b78..267b82ff2374a43cb38617a648c5bfa58ef2b039:/lisp/desktop.el diff --git a/lisp/desktop.el b/lisp/desktop.el index 5d9982940b..75deb58b4d 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -34,7 +34,7 @@ ;; - some local variables ;; To use this, use customize to turn on desktop-save-mode or add the -;; following line somewhere in your .emacs file: +;; following line somewhere in your init file: ;; ;; (desktop-save-mode 1) ;; @@ -220,7 +220,7 @@ the normal hook `desktop-not-loaded-hook' is run." :group 'desktop :version "22.2") -(defcustom desktop-path (list "." user-emacs-directory "~") +(defcustom desktop-path (list user-emacs-directory "~") "List of directories to search for the desktop file. The base name of the file is specified in `desktop-base-file-name'." :type '(repeat directory) @@ -410,8 +410,7 @@ is passed as the argument DESKTOP-BUFFER-MISC to functions in 'desktop-save-buffer "22.1") ;;;###autoload -(defvar desktop-buffer-mode-handlers - nil +(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 @@ -471,8 +470,7 @@ this table. See also `desktop-minor-mode-handlers'." :group 'desktop) ;;;###autoload -(defvar desktop-minor-mode-handlers - nil +(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 @@ -968,8 +966,8 @@ It returns t if a desktop file was loaded, nil otherwise." (and dirs (car dirs))) ;; If not found and `desktop-path' is non-nil, use its first element. (and desktop-path (car desktop-path)) - ;; Default: Home directory. - "~")))) + ;; Default: .emacs.d. + user-emacs-directory)))) (if (file-exists-p (desktop-full-file-name)) ;; Desktop file found, but is it already in use? (let ((desktop-first-buffer nil) @@ -981,6 +979,7 @@ It returns t if a desktop file was loaded, nil otherwise." (if (and owner (memq desktop-load-locked-desktop '(nil ask)) (or (null desktop-load-locked-desktop) + (daemonp) (not (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\ Using it may cause conflicts. Use it anyway? " owner))))) (let ((default-directory desktop-dirname)) @@ -1120,11 +1119,8 @@ directory DIRNAME." (defun desktop-load-file (function) "Load the file where auto loaded FUNCTION is defined." - (when function - (let ((fcell (and (fboundp function) (symbol-function function)))) - (when (and (listp fcell) - (eq 'autoload (car fcell))) - (load (cadr fcell)))))) + (when (fboundp function) + (autoload-do-load (symbol-function function) function))) ;; ---------------------------------------------------------------------------- ;; Create a buffer, load its file, set its mode, ...;