(diff-end-of-hunk): Revert 2008-01-08 change.
[bpt/emacs.git] / lisp / desktop.el
index 4ee378a..4837aee 100644 (file)
@@ -1,7 +1,7 @@
 ;;; desktop.el --- save partial status of Emacs when killed
 
 ;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Morten Welinder <terra@diku.dk>
 ;; Keywords: convenience
@@ -11,7 +11,7 @@
 
 ;; 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
@@ -204,7 +206,7 @@ the normal hook `desktop-not-loaded-hook' is run."
     (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")
@@ -219,7 +221,7 @@ the normal hook `desktop-not-loaded-hook' is run."
   "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.
@@ -253,7 +255,7 @@ May be used to deal with accidental multiple Emacs jobs."
   :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'.
@@ -454,7 +456,8 @@ Furthermore the major mode function must be autoloaded.")
 (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
@@ -648,12 +651,16 @@ is nil, ask the user where to save the desktop."
       value)))
 
 ;; ----------------------------------------------------------------------------
+(declare-function uniquify-item-base "uniquify" (cl-x) t) ; defstruct
+
 (defun desktop-buffer-info (buffer)
   (set-buffer buffer)
   (list
    ;; basic information
    (desktop-file-name (buffer-file-name) desktop-dirname)
-   (buffer-name)
+   (if (bound-and-true-p uniquify-managed)
+       (uniquify-item-base (car uniquify-managed))
+     (buffer-name))
    major-mode
    ;; minor modes
    (let (ret)
@@ -1149,7 +1156,7 @@ directory DIRNAME."
           (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))