]> git.eshelyaron.com Git - emacs.git/commitdiff
(ido-read-internal): Only pop stack elements automatically if they
authorKim F. Storm <storm@cua.dk>
Thu, 8 Jun 2006 11:29:27 +0000 (11:29 +0000)
committerKim F. Storm <storm@cua.dk>
Thu, 8 Jun 2006 11:29:27 +0000 (11:29 +0000)
actually match an existing directory or file name.

lisp/ido.el

index 08d5c91d203fb647646eb7ff934bc6c247be5662..a4c26b52c981e5ce2845665f0535054377519c33 100644 (file)
@@ -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)))