summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-10-30 23:28:12 +0000
committerMiles Bader <miles@gnu.org>2007-10-30 23:28:12 +0000
commitba69b876ac836a88877dab99e6fc2352dd36c855 (patch)
treeea26f4dfdee15465752767ec150b509aae48f52e
parent904fac674eb51808091bed8f7c608745e0dfc0b8 (diff)
parent93c5a976a01b25f96bb135086d8fcd3a869b3fb9 (diff)
downloademacs-ba69b876ac836a88877dab99e6fc2352dd36c855.tar.gz
Merge from emacs--rel--22
Patches applied: * emacs--rel--22 (patch 138-139) - Update from CVS Revision: emacs@sv.gnu.org/emacs--devo--0--patch-914
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/desktop.el8
-rw-r--r--lisp/uniquify.el12
3 files changed, 17 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e5ace8aae86..8b10517db2e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2007-10-27 Juanma Barranquero <lekktu@gmail.com>
+
+ * desktop.el (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.
+
2007-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
* doc-view.el: Use expand-file-name rather than concat.
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 040688492a4..4707904b28b 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -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
@@ -654,7 +656,9 @@ is nil, ask the user where to save the desktop."
(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)
@@ -1150,7 +1154,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))
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index 8226c65cbb9..254832ed700 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -460,15 +460,9 @@ in `uniquify-list-buffers-directory-modes', otherwise returns nil."
;; Buffer deletion
;; Rerationalize after a buffer is killed, to reduce coinciding buffer names.
-;; This mechanism uses `kill-buffer-hook', which runs *before* deletion.
-;; That means that the kill-buffer-hook function cannot just delete the
-;; buffer -- it has to set something to do the rationalization *later*.
-;; It actually puts another function on `post-command-hook'. This other
-;; function runs the rationalization and then removes itself from the hook.
-;; Is there a better way to accomplish this?
-;; (This ought to set some global variables so the work is done only for
-;; buffers with names similar to the deleted buffer. -MDE)
-
+;; This mechanism uses `kill-buffer-hook', which runs *before* deletion, so
+;; it calls `uniquify-rerationalize-w/o-cb' to rerationalize the buffer list
+;; ignoring the current buffer (which is going to be deleted anyway).
(defun uniquify-maybe-rerationalize-w/o-cb ()
"Re-rationalize buffer names, ignoring current buffer.
For use on `kill-buffer-hook'."