diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2008-02-14 14:37:00 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2008-02-14 14:37:00 +0000 |
commit | a8049a30d55310baa45f5fd0dfd0d3937dd31b00 (patch) | |
tree | ad771b57f9aeabb9721a0501fe87e927dcdbb43f /lisp/desktop.el | |
parent | 20c4d633d37bfe4f7ad1295d9dc09e78b4936bb9 (diff) | |
download | emacs-a8049a30d55310baa45f5fd0dfd0d3937dd31b00.tar.gz |
(uniquify-managed): Don't defvar.
(desktop-buffer-info): Use `uniquify-buffer-base-name', not `uniquify-managed'.
Return also the buffer's base name.
(desktop-save): When saving the buffer info, filter out the base name, and save
it as buffer name if the buffer is managed by uniquify.
(uniquify-item-base): Don't declare; not called anymore.
Diffstat (limited to 'lisp/desktop.el')
-rw-r--r-- | lisp/desktop.el | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el index 19d066a8008..f65c68ec4e6 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -135,8 +135,6 @@ ;;; 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 @@ -651,16 +649,14 @@ 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 + ;; base name of the buffer; replaces the buffer name if managed by uniquify + (and (fboundp 'uniquify-buffer-base-name) (uniquify-buffer-base-name)) ;; basic information (desktop-file-name (buffer-file-name) desktop-dirname) - (if (bound-and-true-p uniquify-managed) - (uniquify-item-base (car uniquify-managed)) - (buffer-name)) + (buffer-name) major-mode ;; minor modes (let (ret) @@ -890,19 +886,22 @@ See also `desktop-base-file-name'." (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") (dolist (l (mapcar 'desktop-buffer-info (buffer-list))) - (when (apply 'desktop-save-buffer-p l) - (insert "(" - (if (or (not (integerp eager)) - (if (zerop eager) - nil - (setq eager (1- eager)))) - "desktop-create-buffer" - "desktop-append-buffer-args") - " " - desktop-file-version) - (dolist (e l) - (insert "\n " (desktop-value-to-string e))) - (insert ")\n\n"))) + (let ((base (pop l))) + (when (apply 'desktop-save-buffer-p l) + (insert "(" + (if (or (not (integerp eager)) + (if (zerop eager) + nil + (setq eager (1- eager)))) + "desktop-create-buffer" + "desktop-append-buffer-args") + " " + desktop-file-version) + ;; If the base name is non-nil, we save it instead of the buffer name + (when base (setcar (nthcdr 1 l) base)) + (dolist (e l) + (insert "\n " (desktop-value-to-string e))) + (insert ")\n\n")))) (setq default-directory desktop-dirname) (let ((coding-system-for-write 'emacs-mule)) |