summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2013-07-09 13:09:45 +0800
committerLeo Liu <sdl.web@gmail.com>2013-07-09 13:09:45 +0800
commitc28b9050d55c19317cfab3ff5f9d0cf749ef1ac2 (patch)
tree06d8d682785fda6631e4c887882983b641c3d3b5
parentcf7a0de6e75d2c510e69ab77bc70279cba7c48ba (diff)
downloademacs-c28b9050d55c19317cfab3ff5f9d0cf749ef1ac2.tar.gz
emacs-c28b9050d55c19317cfab3ff5f9d0cf749ef1ac2.tar.bz2
emacs-c28b9050d55c19317cfab3ff5f9d0cf749ef1ac2.zip
* ido.el (ido-add-virtual-buffers-to-list): Robustify. (Bug#14552)
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/ido.el10
2 files changed, 9 insertions, 2 deletions
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 <dgutov@yandex.ru>
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))