From: Stefan Monnier Date: Wed, 5 Jan 2005 21:49:02 +0000 (+0000) Subject: (uniquify-rationalize-file-buffer-names): Fix corner case when renaming X-Git-Tag: ttn-vms-21-2-B4~2902 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9890ec7d19285475a18f191a695eaf4cd90ba6a3;p=emacs.git (uniquify-rationalize-file-buffer-names): Fix corner case when renaming to the same name. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a7f548cf0b0..0583c16fcd4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/uniquify.el b/lisp/uniquify.el index 689dffb9618..ea9094da78a 100644 --- a/lisp/uniquify.el +++ b/lisp/uniquify.el @@ -194,8 +194,10 @@ this rationalization." (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)