;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;;; Code:
+(defvar uniquify-managed)
+
(defvar desktop-file-version "206"
"Version number of desktop file format.
Written into the desktop file and used at desktop read to provide
(const :tag "Don't load" nil)
(const :tag "Ask the user" ask))
:group 'desktop
- :version "23.1")
+ :version "22.2")
(defcustom desktop-base-file-name
(convert-standard-filename ".emacs.desktop")
"Name of lock file for Emacs desktop, excluding the directory part."
:type 'file
:group 'desktop
- :version "23.1")
+ :version "22.2")
(defcustom desktop-path '("." "~")
"List of directories to search for the desktop file.
:type 'hook
:group 'desktop
:options '(desktop-save-mode-off save-buffers-kill-emacs)
- :version "23.1")
+ :version "22.2")
(defcustom desktop-after-read-hook nil
"Normal hook run after a successful `desktop-read'.
(defcustom desktop-minor-mode-table
'((auto-fill-function auto-fill-mode)
(vc-mode nil)
- (vc-dired-mode nil))
+ (vc-dired-mode nil)
+ (erc-track-minor-mode nil))
"Table mapping minor mode variables to minor mode functions.
Each entry has the form (NAME RESTORE-FUNCTION).
NAME is the name of the buffer-local variable indicating that the minor
(set-buffer buffer)
(list
;; basic information
- (desktop-file-name (buffer-file-name) dirname)
- (buffer-name)
+ (desktop-file-name (buffer-file-name) desktop-dirname)
+ (if (bound-and-true-p uniquify-managed)
+ (uniquify-item-base (car uniquify-managed))
+ (buffer-name))
major-mode
;; minor modes
(let (ret)
buffer-read-only
;; auxiliary information
(when (functionp desktop-save-buffer)
- (funcall desktop-save-buffer dirname))
+ (funcall desktop-save-buffer desktop-dirname))
;; local variables
(let ((locals desktop-locals-to-save)
(loclist (buffer-local-variables))
(insert "\n " (desktop-value-to-string e)))
(insert ")\n\n")))
- (setq default-directory dirname)
+ (setq default-directory desktop-dirname)
(let ((coding-system-for-write 'emacs-mule))
(write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage))
;; We remember when it was modified (which is presumably just now).
(setq desktop-first-buffer result))
(set-buffer result)
(unless (equal (buffer-name) desktop-buffer-name)
- (rename-buffer desktop-buffer-name))
+ (rename-buffer desktop-buffer-name t))
;; minor modes
(cond ((equal '(t) desktop-buffer-minor-modes) ; backwards compatible
(auto-fill-mode 1))