# HG changeset patch # User Kim F. Storm # Date 1147901159 0 # Node ID 8fd6ecfbe6ea8fa5fbaaf98456621a24cf1e9c18 # Parent 371a6845f023b00ca9b4eea7c20d8c8a5d58bd41 (ido-read-internal): Use only nondirectory part of default item. diff -r 371a6845f023 -r 8fd6ecfbe6ea lisp/ido.el --- a/lisp/ido.el Wed May 17 21:25:47 2006 +0000 +++ b/lisp/ido.el Wed May 17 21:25:59 2006 +0000 @@ -1778,7 +1778,7 @@ "Perform the `ido-read-buffer' and `ido-read-file-name' functions. Return the name of a buffer or file selected. PROMPT is the prompt to give to the user. -DEFAULT if given is the default directory to start with. +DEFAULT if given is the default item to start with. If REQUIRE-MATCH is non-nil, an existing file must be selected. If INITIAL is non-nil, it specifies the initial input string." (let @@ -1822,7 +1822,10 @@ (cond ((eq item 'buffer) (if (bufferp default) (buffer-name default) default)) - ((stringp default) default) + ((stringp default) + (if (memq item '(file dir)) + (file-name-nondirectory default) + default)) ((eq item 'file) (and ido-enable-last-directory-history (let ((d (assoc ido-current-directory ido-last-directory-list)))