diff lisp/ido.el @ 71275:aa026ce4fcef

(ido-read-internal): Only pop stack elements automatically if they actually match an existing directory or file name.
author Kim F. Storm <storm@cua.dk>
date Thu, 08 Jun 2006 11:29:27 +0000
parents f8990e674d00
children d35d3efc3d99 138027c8c982
line wrap: on
line diff
--- a/lisp/ido.el	Thu Jun 08 11:29:14 2006 +0000
+++ b/lisp/ido.el	Thu Jun 08 11:29:27 2006 +0000
@@ -2094,8 +2094,10 @@
 			(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)))