From 08bfde76b7d27d6c3d753e18ac1e82f57ccba0ac Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 22 Oct 2002 22:27:50 +0000 Subject: [PATCH] (ido-restrict-to-matches): New command. (ido-define-mode-map): Bind it to C-SPC and C-@ in ido-mode-map. --- lisp/ido.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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." (define-key map "\C-s" 'ido-next-match) (define-key map "\C-t" 'ido-toggle-regexp) (define-key map "\C-z" 'ido-undo-merge-work-directory) + (define-key map [(control ? )] 'ido-restrict-to-matches) + (define-key map [(control ?@)] 'ido-restrict-to-matches) (define-key map [right] 'ido-next-match) (define-key map [left] 'ido-prev-match) (define-key map "?" 'ido-completion-help) @@ -2361,6 +2363,16 @@ for first matching file." (if (> i 0) (setq ido-cur-list (ido-chop ido-cur-list (nth i ido-matches))))))) +(defun ido-restrict-to-matches () + "Set current item list to the currently matched items." + (interactive) + (when ido-matches + (setq ido-cur-list ido-matches + ido-text-init "" + ido-rescan nil + ido-exit 'keep) + (exit-minibuffer))) + (defun ido-chop (items elem) "Remove all elements before ELEM and put them at the end of ITEMS." (let ((ret nil) -- 2.39.2