From 11ae5e81755e27bc2b4bb9169a06c14e2bca53f9 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 8 Jun 2006 11:29:27 +0000 Subject: [PATCH] (ido-read-internal): Only pop stack elements automatically if they actually match an existing directory or file name. --- lisp/ido.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ido.el b/lisp/ido.el index 08d5c91d203..a4c26b52c98 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -2094,8 +2094,10 @@ If INITIAL is non-nil, it specifies the initial input string." (cons (cons ido-current-directory ido-selected) ido-last-directory-list))))) (ido-set-current-directory ido-current-directory ido-selected) (if ido-input-stack - (while ido-input-stack - (let ((elt (car ido-input-stack))) + ; automatically pop stack elements which match existing files or directories + (let (elt) + (while (and (setq elt (car ido-input-stack)) + (file-exists-p (concat ido-current-directory (cdr elt)))) (if (setq ido-input-stack (cdr ido-input-stack)) (ido-set-current-directory ido-current-directory (cdr elt)) (setq ido-text-init (cdr elt))) -- 2.39.5