diff options
| author | Leo Liu | 2011-03-25 08:42:26 +0800 |
|---|---|---|
| committer | Leo Liu | 2011-03-25 08:42:26 +0800 |
| commit | c5b40130ec56efef7b99b7b7ad249091773dfe87 (patch) | |
| tree | 0e986079677deefc399815a046d085d4b197f872 | |
| parent | d86d2721aa386e943f159895afc4bf2fd53eafd9 (diff) | |
| download | emacs-c5b40130ec56efef7b99b7b7ad249091773dfe87.tar.gz emacs-c5b40130ec56efef7b99b7b7ad249091773dfe87.zip | |
Some ido cleanups
* ido.el (ido-read-internal): Simplify with read-from-minibuffer.
(ido-completions): Remove unused arguments. (Bug#8329)
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/ido.el | 33 |
2 files changed, 15 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d2403f0e53e..f07ac0953ff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-03-25 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * ido.el (ido-read-internal): Simplify with read-from-minibuffer. | ||
| 4 | (ido-completions): Remove unused arguments. (Bug#8329) | ||
| 5 | |||
| 1 | 2011-03-24 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2011-03-24 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * minibuffer.el (completion--flush-all-sorted-completions): | 8 | * minibuffer.el (completion--flush-all-sorted-completions): |
diff --git a/lisp/ido.el b/lisp/ido.el index df7516993b7..177f9338870 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1964,17 +1964,9 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1964 | (ido-set-matches) | 1964 | (ido-set-matches) |
| 1965 | (if (and ido-matches (eq ido-try-merged-list 'auto)) | 1965 | (if (and ido-matches (eq ido-try-merged-list 'auto)) |
| 1966 | (setq ido-try-merged-list t)) | 1966 | (setq ido-try-merged-list t)) |
| 1967 | (let | 1967 | (let ((max-mini-window-height (or ido-max-window-height |
| 1968 | ((minibuffer-local-completion-map | 1968 | (and (boundp 'max-mini-window-height) |
| 1969 | (if (memq ido-cur-item '(file dir)) | 1969 | max-mini-window-height))) |
| 1970 | minibuffer-local-completion-map | ||
| 1971 | ido-completion-map)) | ||
| 1972 | (minibuffer-local-filename-completion-map | ||
| 1973 | (if (memq ido-cur-item '(file dir)) | ||
| 1974 | ido-completion-map | ||
| 1975 | minibuffer-local-filename-completion-map)) | ||
| 1976 | (max-mini-window-height (or ido-max-window-height | ||
| 1977 | (and (boundp 'max-mini-window-height) max-mini-window-height))) | ||
| 1978 | (ido-completing-read t) | 1970 | (ido-completing-read t) |
| 1979 | (ido-require-match require-match) | 1971 | (ido-require-match require-match) |
| 1980 | (ido-use-mycompletion-depth (1+ (minibuffer-depth))) | 1972 | (ido-use-mycompletion-depth (1+ (minibuffer-depth))) |
| @@ -1985,12 +1977,11 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1985 | (setq ido-exit nil) | 1977 | (setq ido-exit nil) |
| 1986 | (setq ido-final-text | 1978 | (setq ido-final-text |
| 1987 | (catch 'ido | 1979 | (catch 'ido |
| 1988 | (completing-read-default | 1980 | (read-from-minibuffer (ido-make-prompt item prompt) |
| 1989 | (ido-make-prompt item prompt) | 1981 | (prog1 ido-text-init |
| 1990 | '(("dummy" . 1)) nil nil ; table predicate require-match | 1982 | (setq ido-text-init nil)) |
| 1991 | (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents | 1983 | ido-completion-map nil history)))) |
| 1992 | history)))) | 1984 | (ido-trace "read-from-minibuffer" ido-final-text) |
| 1993 | (ido-trace "completing-read" ido-final-text) | ||
| 1994 | (if (get-buffer ido-completion-buffer) | 1985 | (if (get-buffer ido-completion-buffer) |
| 1995 | (kill-buffer ido-completion-buffer)) | 1986 | (kill-buffer ido-completion-buffer)) |
| 1996 | 1987 | ||
| @@ -4494,17 +4485,13 @@ For details of keybindings, see `ido-find-file'." | |||
| 4494 | 4485 | ||
| 4495 | ;; Insert the match-status information: | 4486 | ;; Insert the match-status information: |
| 4496 | (ido-set-common-completion) | 4487 | (ido-set-common-completion) |
| 4497 | (let ((inf (ido-completions | 4488 | (let ((inf (ido-completions contents))) |
| 4498 | contents | ||
| 4499 | minibuffer-completion-table | ||
| 4500 | minibuffer-completion-predicate | ||
| 4501 | (not minibuffer-completion-confirm)))) | ||
| 4502 | (setq ido-show-confirm-message nil) | 4489 | (setq ido-show-confirm-message nil) |
| 4503 | (ido-trace "inf" inf) | 4490 | (ido-trace "inf" inf) |
| 4504 | (insert inf)) | 4491 | (insert inf)) |
| 4505 | )))) | 4492 | )))) |
| 4506 | 4493 | ||
| 4507 | (defun ido-completions (name candidates predicate require-match) | 4494 | (defun ido-completions (name) |
| 4508 | ;; Return the string that is displayed after the user's text. | 4495 | ;; Return the string that is displayed after the user's text. |
| 4509 | ;; Modified from `icomplete-completions'. | 4496 | ;; Modified from `icomplete-completions'. |
| 4510 | 4497 | ||