# HG changeset patch # User Miles Bader # Date 1193786892 0 # Node ID d93ce6f797f62b93b06c2f8ee6a4b06e5ccac6f9 # Parent 2a9d361b3986c938bc6d7e9f01000e2d5fccc839# Parent 82fb16d03f6f9a97461eca6d969d1d756217d492 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 diff -r 2a9d361b3986 -r d93ce6f797f6 lisp/ChangeLog --- a/lisp/ChangeLog Tue Oct 30 23:27:59 2007 +0000 +++ b/lisp/ChangeLog Tue Oct 30 23:28:12 2007 +0000 @@ -1,3 +1,11 @@ +2007-10-27 Juanma Barranquero + + * 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 * doc-view.el: Use expand-file-name rather than concat. diff -r 2a9d361b3986 -r d93ce6f797f6 lisp/desktop.el --- a/lisp/desktop.el Tue Oct 30 23:27:59 2007 +0000 +++ b/lisp/desktop.el Tue Oct 30 23:28:12 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 @@ -654,7 +656,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) @@ -1150,7 +1154,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)) diff -r 2a9d361b3986 -r d93ce6f797f6 lisp/uniquify.el --- a/lisp/uniquify.el Tue Oct 30 23:27:59 2007 +0000 +++ b/lisp/uniquify.el Tue Oct 30 23:28:12 2007 +0000 @@ -460,15 +460,9 @@ ;; 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'."