changeset 70690:8fd6ecfbe6ea

(ido-read-internal): Use only nondirectory part of default item.
author Kim F. Storm <storm@cua.dk>
date Wed, 17 May 2006 21:25:59 +0000
parents 371a6845f023
children a69f2db3d3ae
files lisp/ido.el
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)))