summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2005-05-19 21:08:14 +0000
committerKim F. Storm <storm@cua.dk>2005-05-19 21:08:14 +0000
commitcc2691b7ee27dd8eb0cbb54fccce35a705e62cbf (patch)
tree6fd65f7ed97e55f71f2658b027a528e8a6531bd6 /lisp/ido.el
parentf4056bf7b6fc6f844fa0619466b17ade7e3e84ed (diff)
downloademacs-cc2691b7ee27dd8eb0cbb54fccce35a705e62cbf.tar.gz
(ido-magic-forward-char): Enter ido-find-file at end of input.
(ido-magic-backward-char): Enter ido-switch-buffer at start of input.
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el34
1 files changed, 22 insertions, 12 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index d7c0c8aa9ea..24b8ba34b75 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2267,31 +2267,41 @@ If no merge has yet taken place, toggle automatic merging option."
(defun ido-magic-forward-char ()
"Move forward in user input or perform magic action.
-If no user input is present, perform magic actions:
-C-x C-f C-f fallback to non-ido find-file.
-C-x C-d C-f fallback to non-ido brief dired.
-C-x d C-f fallback to non-ido dired."
+If no user input is present or at end of input, perform magic actions:
+C-x C-b ... C-f switch to ido-find-file.
+C-x C-f ... C-f fallback to non-ido find-file.
+C-x C-d ... C-f fallback to non-ido brief dired.
+C-x d ... C-f fallback to non-ido dired."
(interactive)
(cond
((not (eobp))
(forward-char 1))
- ((and (= (length ido-text) 0)
- (memq ido-cur-item '(file dir)))
- (ido-fallback-command))))
+ ((memq ido-cur-item '(file dir))
+ (ido-fallback-command))
+ (ido-context-switch-command
+ (call-interactively ido-context-switch-command))
+ ((eq ido-cur-item 'buffer)
+ (ido-enter-find-file))))
;;; Magic C-b
(defun ido-magic-backward-char ()
"Move backward in user input or perform magic action.
-If no user input is present, perform magic actions:
+If no user input is present, or at start of input, perform magic actions:
+C-x C-f C-b switch to ido-switch-buffer.
+C-x C-d C-b switch to ido-switch-buffer.
+C-x d C-b switch to ido-switch-buffer.
C-x C-b C-b fallback to non-ido switch-to-buffer."
(interactive)
(cond
- ((> (length ido-text) 0)
- (if (> (point) (minibuffer-prompt-end))
- (forward-char -1)))
+ ((> (point) (minibuffer-prompt-end))
+ (forward-char -1))
((eq ido-cur-item 'buffer)
- (ido-fallback-command))))
+ (ido-fallback-command))
+ (ido-context-switch-command
+ (call-interactively ido-context-switch-command))
+ (t
+ (ido-enter-switch-buffer))))
;;; Magic C-d