# HG changeset patch # User Kim F. Storm # Date 1149766167 0 # Node ID aa026ce4fcefa372da2e02cad6726c8d50ff30ba # Parent 9c646f1ba2dfe421d00d64051ef9acadc689b6b7 (ido-read-internal): Only pop stack elements automatically if they actually match an existing directory or file name. diff -r 9c646f1ba2df -r aa026ce4fcef lisp/ido.el --- 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)))