diff options
| author | Kim F. Storm | 2005-05-19 21:08:14 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-05-19 21:08:14 +0000 |
| commit | cc2691b7ee27dd8eb0cbb54fccce35a705e62cbf (patch) | |
| tree | 6fd65f7ed97e55f71f2658b027a528e8a6531bd6 | |
| parent | f4056bf7b6fc6f844fa0619466b17ade7e3e84ed (diff) | |
| download | emacs-cc2691b7ee27dd8eb0cbb54fccce35a705e62cbf.tar.gz emacs-cc2691b7ee27dd8eb0cbb54fccce35a705e62cbf.zip | |
(ido-magic-forward-char): Enter ido-find-file at end of input.
(ido-magic-backward-char): Enter ido-switch-buffer at start of input.
| -rw-r--r-- | lisp/ido.el | 34 |
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." | |||
| 2267 | 2267 | ||
| 2268 | (defun ido-magic-forward-char () | 2268 | (defun ido-magic-forward-char () |
| 2269 | "Move forward in user input or perform magic action. | 2269 | "Move forward in user input or perform magic action. |
| 2270 | If no user input is present, perform magic actions: | 2270 | If no user input is present or at end of input, perform magic actions: |
| 2271 | C-x C-f C-f fallback to non-ido find-file. | 2271 | C-x C-b ... C-f switch to ido-find-file. |
| 2272 | C-x C-d C-f fallback to non-ido brief dired. | 2272 | C-x C-f ... C-f fallback to non-ido find-file. |
| 2273 | C-x d C-f fallback to non-ido dired." | 2273 | C-x C-d ... C-f fallback to non-ido brief dired. |
| 2274 | C-x d ... C-f fallback to non-ido dired." | ||
| 2274 | (interactive) | 2275 | (interactive) |
| 2275 | (cond | 2276 | (cond |
| 2276 | ((not (eobp)) | 2277 | ((not (eobp)) |
| 2277 | (forward-char 1)) | 2278 | (forward-char 1)) |
| 2278 | ((and (= (length ido-text) 0) | 2279 | ((memq ido-cur-item '(file dir)) |
| 2279 | (memq ido-cur-item '(file dir))) | 2280 | (ido-fallback-command)) |
| 2280 | (ido-fallback-command)))) | 2281 | (ido-context-switch-command |
| 2282 | (call-interactively ido-context-switch-command)) | ||
| 2283 | ((eq ido-cur-item 'buffer) | ||
| 2284 | (ido-enter-find-file)))) | ||
| 2281 | 2285 | ||
| 2282 | ;;; Magic C-b | 2286 | ;;; Magic C-b |
| 2283 | 2287 | ||
| 2284 | (defun ido-magic-backward-char () | 2288 | (defun ido-magic-backward-char () |
| 2285 | "Move backward in user input or perform magic action. | 2289 | "Move backward in user input or perform magic action. |
| 2286 | If no user input is present, perform magic actions: | 2290 | If no user input is present, or at start of input, perform magic actions: |
| 2291 | C-x C-f C-b switch to ido-switch-buffer. | ||
| 2292 | C-x C-d C-b switch to ido-switch-buffer. | ||
| 2293 | C-x d C-b switch to ido-switch-buffer. | ||
| 2287 | C-x C-b C-b fallback to non-ido switch-to-buffer." | 2294 | C-x C-b C-b fallback to non-ido switch-to-buffer." |
| 2288 | (interactive) | 2295 | (interactive) |
| 2289 | (cond | 2296 | (cond |
| 2290 | ((> (length ido-text) 0) | 2297 | ((> (point) (minibuffer-prompt-end)) |
| 2291 | (if (> (point) (minibuffer-prompt-end)) | 2298 | (forward-char -1)) |
| 2292 | (forward-char -1))) | ||
| 2293 | ((eq ido-cur-item 'buffer) | 2299 | ((eq ido-cur-item 'buffer) |
| 2294 | (ido-fallback-command)))) | 2300 | (ido-fallback-command)) |
| 2301 | (ido-context-switch-command | ||
| 2302 | (call-interactively ido-context-switch-command)) | ||
| 2303 | (t | ||
| 2304 | (ido-enter-switch-buffer)))) | ||
| 2295 | 2305 | ||
| 2296 | ;;; Magic C-d | 2306 | ;;; Magic C-d |
| 2297 | 2307 | ||