diff options
| author | Kim F. Storm | 2006-06-07 22:05:05 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-06-07 22:05:05 +0000 |
| commit | a3f4d4d43c81b82807d03b39f3224892840fadf0 (patch) | |
| tree | 39d567204a80dc69099eca0354d35d4d7f2353de | |
| parent | f17f26a1cbd3908061899c39698f231dc32b3aa2 (diff) | |
| download | emacs-a3f4d4d43c81b82807d03b39f3224892840fadf0.tar.gz emacs-a3f4d4d43c81b82807d03b39f3224892840fadf0.zip | |
(ido-take-first-match, ido-push-dir-first): New commands.
(ido-init-completion-maps): Bind them to M-SPC and M-v.
| -rw-r--r-- | lisp/ido.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 344f8a667a1..1bc9a4dcef7 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1538,6 +1538,7 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." | |||
| 1538 | (define-key map "\C-t" 'ido-toggle-regexp) | 1538 | (define-key map "\C-t" 'ido-toggle-regexp) |
| 1539 | (define-key map "\C-z" 'ido-undo-merge-work-directory) | 1539 | (define-key map "\C-z" 'ido-undo-merge-work-directory) |
| 1540 | (define-key map [(control ?\s)] 'ido-restrict-to-matches) | 1540 | (define-key map [(control ?\s)] 'ido-restrict-to-matches) |
| 1541 | (define-key map [(meta ?\s)] 'ido-take-first-match) | ||
| 1541 | (define-key map [(control ?@)] 'ido-restrict-to-matches) | 1542 | (define-key map [(control ?@)] 'ido-restrict-to-matches) |
| 1542 | (define-key map [right] 'ido-next-match) | 1543 | (define-key map [right] 'ido-next-match) |
| 1543 | (define-key map [left] 'ido-prev-match) | 1544 | (define-key map [left] 'ido-prev-match) |
| @@ -1565,6 +1566,7 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise." | |||
| 1565 | (define-key map "\C-l" 'ido-reread-directory) | 1566 | (define-key map "\C-l" 'ido-reread-directory) |
| 1566 | (define-key map [(meta ?d)] 'ido-wide-find-dir-or-delete-dir) | 1567 | (define-key map [(meta ?d)] 'ido-wide-find-dir-or-delete-dir) |
| 1567 | (define-key map [(meta ?b)] 'ido-push-dir) | 1568 | (define-key map [(meta ?b)] 'ido-push-dir) |
| 1569 | (define-key map [(meta ?v)] 'ido-push-dir-first) | ||
| 1568 | (define-key map [(meta ?f)] 'ido-wide-find-file-or-pop-dir) | 1570 | (define-key map [(meta ?f)] 'ido-wide-find-file-or-pop-dir) |
| 1569 | (define-key map [(meta ?k)] 'ido-forget-work-directory) | 1571 | (define-key map [(meta ?k)] 'ido-forget-work-directory) |
| 1570 | (define-key map [(meta ?m)] 'ido-make-directory) | 1572 | (define-key map [(meta ?m)] 'ido-make-directory) |
| @@ -2805,12 +2807,28 @@ If input stack is non-empty, delete current directory component." | |||
| 2805 | (ido-delete-backward-word-updir 1) | 2807 | (ido-delete-backward-word-updir 1) |
| 2806 | (ido-wide-find-dir))) | 2808 | (ido-wide-find-dir))) |
| 2807 | 2809 | ||
| 2810 | (defun ido-take-first-match () | ||
| 2811 | "Use first matching item as input text." | ||
| 2812 | (interactive) | ||
| 2813 | (when ido-matches | ||
| 2814 | (setq ido-text-init (car ido-matches)) | ||
| 2815 | (setq ido-exit 'refresh) | ||
| 2816 | (exit-minibuffer))) | ||
| 2817 | |||
| 2808 | (defun ido-push-dir () | 2818 | (defun ido-push-dir () |
| 2809 | "Move to previous directory in file name, push current input on stack." | 2819 | "Move to previous directory in file name, push current input on stack." |
| 2810 | (interactive) | 2820 | (interactive) |
| 2811 | (setq ido-exit 'push) | 2821 | (setq ido-exit 'push) |
| 2812 | (exit-minibuffer)) | 2822 | (exit-minibuffer)) |
| 2813 | 2823 | ||
| 2824 | (defun ido-push-dir-first () | ||
| 2825 | "Move to previous directory in file name, push first match on stack." | ||
| 2826 | (interactive) | ||
| 2827 | (if ido-matches | ||
| 2828 | (setq ido-text (car ido-matches))) | ||
| 2829 | (setq ido-exit 'push) | ||
| 2830 | (exit-minibuffer)) | ||
| 2831 | |||
| 2814 | (defun ido-pop-dir (arg) | 2832 | (defun ido-pop-dir (arg) |
| 2815 | "Pop directory from input stack back to input. | 2833 | "Pop directory from input stack back to input. |
| 2816 | With \\[universal-argument], pop all element." | 2834 | With \\[universal-argument], pop all element." |