[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: desktop and ~/.emacs.d/
From: |
Davis Herring |
Subject: |
Re: desktop and ~/.emacs.d/ |
Date: |
Mon, 14 Sep 2009 08:17:41 -0700 (PDT) |
User-agent: |
SquirrelMail/1.4.8-5.7.lanl6 |
>> Sounds fine to me; in fact, it might make sense for .emacs.d to be
>> offered as the default location (rather than the directory current at
>> the first invocation of `desktop-save', that `interactive' picks).
>
> A very welcome patch... ;-)
Hey, isn't that my line? ;)
It occurs to me that `user-emacs-directory' isn't always the right
default, because if you want to create multiple desktops, you'll probably
want them near some file that's current when you issue `desktop-save'. So
here's a heuristic: if `desktop-dirname' is nil, so no desktop is loaded,
offer `user-emacs-directory' as a default; otherwise offer the current
directory as before. The only place this seems wrong is when you, say,
abort loading ~/.emacs.d/.emacs.desktop, so that the default would
overwrite it when you probably meant to make a new one elsewhere. But
it's safe: `desktop-save' will prompt intelligently before overwriting it.
Davis
*** cvs/desktop.el 2009-09-14 08:46:20.910215000 -0600
--- new/desktop.el 2009-09-14 09:09:17.649462000 -0600
***************
*** 519,524 ****
--- 519,528 ----
(defvar desktop-dirname nil
"The directory in which the desktop file should be saved.")
+ (defun desktop-read-dirname ()
+ (read-directory-name "Directory to save desktop file in: "
+ (and (not desktop-dirname) user-emacs-directory) nil t))
+
(defun desktop-full-file-name (&optional dirname)
"Return the full name of the desktop file in DIRNAME.
DIRNAME omitted or nil means use `desktop-dirname'."
***************
*** 625,634 ****
(and exists (eq desktop-save 'ask-if-exists)))
(y-or-n-p "Save desktop? ")))))
(unless desktop-dirname
! (setq desktop-dirname
! (file-name-as-directory
! (expand-file-name
! (read-directory-name "Directory for desktop file: " nil nil t)))))
(condition-case err
(desktop-save desktop-dirname t)
(file-error
--- 629,636 ----
(and exists (eq desktop-save 'ask-if-exists)))
(y-or-n-p "Save desktop? ")))))
(unless desktop-dirname
! (setq desktop-dirname (file-name-as-directory
! (expand-file-name (desktop-read-dirname)))))
(condition-case err
(desktop-save desktop-dirname t)
(file-error
***************
*** 850,856 ****
Parameter DIRNAME specifies where to save the desktop file.
Optional parameter RELEASE says whether we're done with this desktop.
See also `desktop-base-file-name'."
! (interactive "DDirectory to save desktop file in: ")
(setq desktop-dirname (file-name-as-directory (expand-file-name
dirname)))
(save-excursion
(let ((eager desktop-restore-eager)
--- 852,858 ----
Parameter DIRNAME specifies where to save the desktop file.
Optional parameter RELEASE says whether we're done with this desktop.
See also `desktop-base-file-name'."
! (interactive (list (desktop-read-dirname)))
(setq desktop-dirname (file-name-as-directory (expand-file-name
dirname)))
(save-excursion
(let ((eager desktop-restore-eager)
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
- Re: bug#4347: Bug for .emacs.d?, (continued)
- Re: bug#4347: Bug for .emacs.d?, Stefan Monnier, 2009/09/13
- Re: bug#4347: Bug for .emacs.d?, Angelo Graziosi, 2009/09/13
- Re: bug#4347: Bug for .emacs.d?, Juanma Barranquero, 2009/09/13
- desktop and ~/.emacs.d/ (was: bug#4347: Bug for .emacs.d?), Reiner Steib, 2009/09/13
- Re: desktop and ~/.emacs.d/, Stefan Monnier, 2009/09/13
- Re: desktop and ~/.emacs.d/, Juanma Barranquero, 2009/09/13
- Re: desktop and ~/.emacs.d/, Davis Herring, 2009/09/14
- Re: desktop and ~/.emacs.d/, Lennart Borgman, 2009/09/14
- Re: desktop and ~/.emacs.d/,
Davis Herring <=