]> git.eshelyaron.com Git - emacs.git/commitdiff
(ido-read-internal): Use only nondirectory part of default item.
authorKim F. Storm <storm@cua.dk>
Wed, 17 May 2006 21:25:59 +0000 (21:25 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 17 May 2006 21:25:59 +0000 (21:25 +0000)
lisp/ido.el

index a622a7e6275b60c9818145deca5666101ebe6bb3..d03c002d5976d1930c79e193b0b008ebdbfacdcf 100644 (file)
@@ -1778,7 +1778,7 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise."
   "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 @@ If INITIAL is non-nil, it specifies the initial input string."
              (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)))