Mercurial > emacs
comparison lisp/ido.el @ 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 | 4521b7c3be30 |
children | 4429856755f0 |
comparison
equal
deleted
inserted
replaced
70689:371a6845f023 | 70690:8fd6ecfbe6ea |
---|---|
1776 | 1776 |
1777 (defun ido-read-internal (item prompt history &optional default require-match initial) | 1777 (defun ido-read-internal (item prompt history &optional default require-match initial) |
1778 "Perform the `ido-read-buffer' and `ido-read-file-name' functions. | 1778 "Perform the `ido-read-buffer' and `ido-read-file-name' functions. |
1779 Return the name of a buffer or file selected. | 1779 Return the name of a buffer or file selected. |
1780 PROMPT is the prompt to give to the user. | 1780 PROMPT is the prompt to give to the user. |
1781 DEFAULT if given is the default directory to start with. | 1781 DEFAULT if given is the default item to start with. |
1782 If REQUIRE-MATCH is non-nil, an existing file must be selected. | 1782 If REQUIRE-MATCH is non-nil, an existing file must be selected. |
1783 If INITIAL is non-nil, it specifies the initial input string." | 1783 If INITIAL is non-nil, it specifies the initial input string." |
1784 (let | 1784 (let |
1785 ((ido-cur-item item) | 1785 ((ido-cur-item item) |
1786 (ido-entry-buffer (current-buffer)) | 1786 (ido-entry-buffer (current-buffer)) |
1820 (when ido-set-default-item | 1820 (when ido-set-default-item |
1821 (setq ido-default-item | 1821 (setq ido-default-item |
1822 (cond | 1822 (cond |
1823 ((eq item 'buffer) | 1823 ((eq item 'buffer) |
1824 (if (bufferp default) (buffer-name default) default)) | 1824 (if (bufferp default) (buffer-name default) default)) |
1825 ((stringp default) default) | 1825 ((stringp default) |
1826 (if (memq item '(file dir)) | |
1827 (file-name-nondirectory default) | |
1828 default)) | |
1826 ((eq item 'file) | 1829 ((eq item 'file) |
1827 (and ido-enable-last-directory-history | 1830 (and ido-enable-last-directory-history |
1828 (let ((d (assoc ido-current-directory ido-last-directory-list))) | 1831 (let ((d (assoc ido-current-directory ido-last-directory-list))) |
1829 (and d (cdr d))))))) | 1832 (and d (cdr d))))))) |
1830 (if (member ido-default-item ido-ignore-item-temp-list) | 1833 (if (member ido-default-item ido-ignore-item-temp-list) |