changeset 81498:a53017ab8b85

(desktop-read): Run `desktop-not-loaded-hook' in the directory where the desktop file was found, as the docstring says. (desktop-kill): Use `read-directory-name'.
author Juanma Barranquero <lekktu@gmail.com>
date Wed, 20 Jun 2007 10:08:07 +0000
parents 6c3d4c79d6e1
children 2b9a3f7e51f0
files lisp/desktop.el
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/desktop.el	Wed Jun 20 10:06:04 2007 +0000
+++ b/lisp/desktop.el	Wed Jun 20 10:08:07 2007 +0000
@@ -626,9 +626,7 @@
       (setq desktop-dirname
             (file-name-as-directory
              (expand-file-name
-              (call-interactively
-               (lambda (dir)
-                 (interactive "DDirectory for desktop file: ") dir))))))
+	      (read-directory-name "Directory for desktop file: " nil nil t)))))
     (condition-case err
 	(desktop-save desktop-dirname t)
       (file-error
@@ -964,9 +962,9 @@
 		       (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)))))
 	      (progn
-		(setq desktop-dirname nil)
 		(let ((default-directory desktop-dirname))
 		  (run-hooks 'desktop-not-loaded-hook))
+		(setq desktop-dirname nil)
 		(message "Desktop file in use; not loaded."))
 	    (desktop-lazy-abort)
 	    ;; Evaluate desktop buffer and remember when it was modified.