# HG changeset patch # User Stefan Monnier # Date 1104961742 0 # Node ID 77618102ddc4f830145df7f6b1635cef61657c19 # Parent 7764df4e45e15bfec5d1ee1fafb08252e91eb31d (uniquify-rationalize-file-buffer-names): Fix corner case when renaming to the same name. diff -r 7764df4e45e1 -r 77618102ddc4 lisp/ChangeLog --- a/lisp/ChangeLog Wed Jan 05 21:20:38 2005 +0000 +++ b/lisp/ChangeLog Wed Jan 05 21:49:02 2005 +0000 @@ -2,6 +2,8 @@ * uniquify.el (uniquify-rationalize-file-buffer-names): Re-add an interactive spec. + (uniquify-rationalize-file-buffer-names): Fix corner case when renaming + to the same name. * isearch.el (isearch-dehighlight): Remove unused arg `totally'. (isearch-update, isearch-done): Adjust calls accordingly. diff -r 7764df4e45e1 -r 77618102ddc4 lisp/uniquify.el --- a/lisp/uniquify.el Wed Jan 05 21:20:38 2005 +0000 +++ b/lisp/uniquify.el Wed Jan 05 21:49:02 2005 +0000 @@ -194,8 +194,10 @@ (uniquify-item-base (car uniquify-managed)) (buffer-name)) (uniquify-buffer-file-name (current-buffer)) (current-buffer))) - (if (null dirname) - (with-current-buffer newbuf (setq uniquify-managed nil)) + ;; Make sure we don't get confused by outdated uniquify-managed info in + ;; this buffer. + (with-current-buffer newbuf (setq uniquify-managed nil)) + (when dirname (setq dirname (expand-file-name (directory-file-name dirname))) (let ((fix-list (list (uniquify-make-item base dirname newbuf))) items)