]> code.delx.au - gnu-emacs/blobdiff - lisp/desktop.el
Merge from emacs-24; up to 2012-12-21T07:35:02Z!ueno@gnu.org
[gnu-emacs] / lisp / desktop.el
index 2fd9d7f10ad5995a10ef025c29c60538e677e0b3..1151bd434bc9a3fb53def09e91a2e13a6ae1f9d3 100644 (file)
@@ -1,6 +1,7 @@
 ;;; desktop.el --- save partial status of Emacs when killed
 
-;; Copyright (C) 1993-1995, 1997, 2000-2012  Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1997, 2000-2013 Free Software Foundation,
+;; Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
 ;; Keywords: convenience
@@ -34,7 +35,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)
 ;;
@@ -825,7 +826,7 @@ MODE is the major mode.
          (or (and filename
                  (stringp desktop-files-not-to-save)
                   (not (string-match desktop-files-not-to-save filename)))
-             (and (eq mode 'dired-mode)
+             (and (memq mode '(dired-mode vc-dir-mode))
                   (with-current-buffer bufname
                     (not (setq dired-skip
                                (string-match desktop-files-not-to-save
@@ -966,8 +967,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)
@@ -1045,11 +1046,10 @@ Using it may cause conflicts.  Use it anyway? " owner)))))
 (defun desktop-load-default ()
   "Load the `default' start-up library manually.
 Also inhibit further loading of it."
+  (declare (obsolete desktop-save-mode "22.1"))
   (unless inhibit-default-init         ; safety check
     (load "default" t t)
     (setq inhibit-default-init t)))
-(make-obsolete 'desktop-load-default
-               'desktop-save-mode "22.1")
 
 ;; ----------------------------------------------------------------------------
 ;;;###autoload
@@ -1119,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, ...;