From: Leo Liu Date: Tue, 9 Jul 2013 05:09:45 +0000 (+0800) Subject: * ido.el (ido-add-virtual-buffers-to-list): Robustify. (Bug#14552) X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1877 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c28b9050d55c19317cfab3ff5f9d0cf749ef1ac2;p=emacs.git * ido.el (ido-add-virtual-buffers-to-list): Robustify. (Bug#14552) --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 562f4739f80..83f824edef0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,7 @@ * ido.el (ido-read-directory-name): Handle fallback. (ido-read-file-name): Update DIR to ido-current-directory. (Bug#1516) + (ido-add-virtual-buffers-to-list): Robustify. (Bug#14552) 2013-07-09 Dmitry Gutov diff --git a/lisp/ido.el b/lisp/ido.el index 12af1952cce..22c8a4e65be 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3461,8 +3461,14 @@ This is to make them appear as if they were \"virtual buffers\"." (setq ido-virtual-buffers nil) (let (name) (dolist (head recentf-list) - (and (setq name (file-name-nondirectory head)) - (null (get-file-buffer head)) + (setq name (file-name-nondirectory head)) + ;; In case HEAD is a directory with trailing /. See bug#14552. + (when (equal name "") + (setq name (file-name-nondirectory (directory-file-name head)))) + (when (equal name "") + (setq name head)) + (and (not (equal name "")) + (null (get-file-buffer head)) (not (assoc name ido-virtual-buffers)) (not (member name ido-temp-list)) (not (ido-ignore-item-p name ido-ignore-buffers))