diff options
| author | Kim F. Storm | 2002-10-22 22:27:50 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-10-22 22:27:50 +0000 |
| commit | 08bfde76b7d27d6c3d753e18ac1e82f57ccba0ac (patch) | |
| tree | bf0b1469fa7b89021dcd4a405108b979f27c7ac7 | |
| parent | 00e98040d106230e0860a7470f7bd9ba01b7cae3 (diff) | |
| download | emacs-08bfde76b7d27d6c3d753e18ac1e82f57ccba0ac.tar.gz emacs-08bfde76b7d27d6c3d753e18ac1e82f57ccba0ac.zip | |
(ido-restrict-to-matches): New command.
(ido-define-mode-map): Bind it to C-SPC and C-@ in ido-mode-map.
| -rw-r--r-- | lisp/ido.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 054c084968e..f9ba8178cba 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1268,6 +1268,8 @@ This function also adds a hook to the minibuffer." | |||
| 1268 | (define-key map "\C-s" 'ido-next-match) | 1268 | (define-key map "\C-s" 'ido-next-match) |
| 1269 | (define-key map "\C-t" 'ido-toggle-regexp) | 1269 | (define-key map "\C-t" 'ido-toggle-regexp) |
| 1270 | (define-key map "\C-z" 'ido-undo-merge-work-directory) | 1270 | (define-key map "\C-z" 'ido-undo-merge-work-directory) |
| 1271 | (define-key map [(control ? )] 'ido-restrict-to-matches) | ||
| 1272 | (define-key map [(control ?@)] 'ido-restrict-to-matches) | ||
| 1271 | (define-key map [right] 'ido-next-match) | 1273 | (define-key map [right] 'ido-next-match) |
| 1272 | (define-key map [left] 'ido-prev-match) | 1274 | (define-key map [left] 'ido-prev-match) |
| 1273 | (define-key map "?" 'ido-completion-help) | 1275 | (define-key map "?" 'ido-completion-help) |
| @@ -2361,6 +2363,16 @@ for first matching file." | |||
| 2361 | (if (> i 0) | 2363 | (if (> i 0) |
| 2362 | (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches))))))) | 2364 | (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches))))))) |
| 2363 | 2365 | ||
| 2366 | (defun ido-restrict-to-matches () | ||
| 2367 | "Set current item list to the currently matched items." | ||
| 2368 | (interactive) | ||
| 2369 | (when ido-matches | ||
| 2370 | (setq ido-cur-list ido-matches | ||
| 2371 | ido-text-init "" | ||
| 2372 | ido-rescan nil | ||
| 2373 | ido-exit 'keep) | ||
| 2374 | (exit-minibuffer))) | ||
| 2375 | |||
| 2364 | (defun ido-chop (items elem) | 2376 | (defun ido-chop (items elem) |
| 2365 | "Remove all elements before ELEM and put them at the end of ITEMS." | 2377 | "Remove all elements before ELEM and put them at the end of ITEMS." |
| 2366 | (let ((ret nil) | 2378 | (let ((ret nil) |