summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2006-06-07 22:05:05 +0000
committerKim F. Storm <storm@cua.dk>2006-06-07 22:05:05 +0000
commita3f4d4d43c81b82807d03b39f3224892840fadf0 (patch)
tree39d567204a80dc69099eca0354d35d4d7f2353de /lisp/ido.el
parentf17f26a1cbd3908061899c39698f231dc32b3aa2 (diff)
downloademacs-a3f4d4d43c81b82807d03b39f3224892840fadf0.tar.gz
(ido-take-first-match, ido-push-dir-first): New commands.
(ido-init-completion-maps): Bind them to M-SPC and M-v.
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el18
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."
(define-key map "\C-t" 'ido-toggle-regexp)
(define-key map "\C-z" 'ido-undo-merge-work-directory)
(define-key map [(control ?\s)] 'ido-restrict-to-matches)
+ (define-key map [(meta ?\s)] 'ido-take-first-match)
(define-key map [(control ?@)] 'ido-restrict-to-matches)
(define-key map [right] 'ido-next-match)
(define-key map [left] 'ido-prev-match)
@@ -1565,6 +1566,7 @@ With ARG, turn ido speed-up on if arg is positive, off otherwise."
(define-key map "\C-l" 'ido-reread-directory)
(define-key map [(meta ?d)] 'ido-wide-find-dir-or-delete-dir)
(define-key map [(meta ?b)] 'ido-push-dir)
+ (define-key map [(meta ?v)] 'ido-push-dir-first)
(define-key map [(meta ?f)] 'ido-wide-find-file-or-pop-dir)
(define-key map [(meta ?k)] 'ido-forget-work-directory)
(define-key map [(meta ?m)] 'ido-make-directory)
@@ -2805,12 +2807,28 @@ If input stack is non-empty, delete current directory component."
(ido-delete-backward-word-updir 1)
(ido-wide-find-dir)))
+(defun ido-take-first-match ()
+ "Use first matching item as input text."
+ (interactive)
+ (when ido-matches
+ (setq ido-text-init (car ido-matches))
+ (setq ido-exit 'refresh)
+ (exit-minibuffer)))
+
(defun ido-push-dir ()
"Move to previous directory in file name, push current input on stack."
(interactive)
(setq ido-exit 'push)
(exit-minibuffer))
+(defun ido-push-dir-first ()
+ "Move to previous directory in file name, push first match on stack."
+ (interactive)
+ (if ido-matches
+ (setq ido-text (car ido-matches)))
+ (setq ido-exit 'push)
+ (exit-minibuffer))
+
(defun ido-pop-dir (arg)
"Pop directory from input stack back to input.
With \\[universal-argument], pop all element."