changeset 79237:80e25357226e

(uniquify-managed): Pacify byte compiler. (desktop-buffer-info): If the buffer name is managed by uniquify, save the base name, not the uniquified one. (desktop-create-buffer): Allow `rename-buffer' to generate a new name in case of conflict.
author Juanma Barranquero <lekktu@gmail.com>
date Sat, 27 Oct 2007 17:10:50 +0000
parents 9e2e45e4da24
children 82fb16d03f6f
files lisp/desktop.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/desktop.el	Sat Oct 27 09:09:14 2007 +0000
+++ b/lisp/desktop.el	Sat Oct 27 17:10:50 2007 +0000
@@ -135,6 +135,8 @@
 
 ;;; 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
@@ -653,7 +655,9 @@
   (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 +1153,7 @@
           (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))