aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2007-02-25 23:48:54 +0000
committerKim F. Storm2007-02-25 23:48:54 +0000
commit16f462c5f9eb3b6b88004cb65cc8ec886bde78c0 (patch)
tree8bfa7efc855b84fc5bfce98e733cc14f1ded54c9
parent7c9fe7ee5930294edf0013ac87ecb4693b30c275 (diff)
downloademacs-16f462c5f9eb3b6b88004cb65cc8ec886bde78c0.tar.gz
emacs-16f462c5f9eb3b6b88004cb65cc8ec886bde78c0.zip
(ido-buffer-internal): Set this-command to fallback command.
Add selected buffer to buffer-name-history. (ido-file-internal): Set this-command to fallback command. Add file names to to file-name-history.
-rw-r--r--lisp/ido.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index ad3f4329e6b..27abe9c9a8f 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2163,9 +2163,9 @@ If cursor is not at the end of the user input, move to end of input."
2163 2163
2164 ((eq ido-exit 'fallback) 2164 ((eq ido-exit 'fallback)
2165 (let ((read-buffer-function nil)) 2165 (let ((read-buffer-function nil))
2166 (run-hook-with-args 'ido-before-fallback-functions 2166 (setq this-command (or fallback 'switch-to-buffer))
2167 (or fallback 'switch-to-buffer)) 2167 (run-hook-with-args 'ido-before-fallback-functions this-command)
2168 (call-interactively (or fallback 'switch-to-buffer)))) 2168 (call-interactively this-command)))
2169 2169
2170 ;; Check buf is non-nil. 2170 ;; Check buf is non-nil.
2171 ((not buf) nil) 2171 ((not buf) nil)
@@ -2173,6 +2173,7 @@ If cursor is not at the end of the user input, move to end of input."
2173 2173
2174 ;; View buffer if it exists 2174 ;; View buffer if it exists
2175 ((get-buffer buf) 2175 ((get-buffer buf)
2176 (add-to-history 'buffer-name-history buf)
2176 (if (eq method 'insert) 2177 (if (eq method 'insert)
2177 (progn 2178 (progn
2178 (ido-record-command 'insert-buffer buf) 2179 (ido-record-command 'insert-buffer buf)
@@ -2192,6 +2193,7 @@ If cursor is not at the end of the user input, move to end of input."
2192 2193
2193 ;; create a new buffer 2194 ;; create a new buffer
2194 (t 2195 (t
2196 (add-to-history 'buffer-name-history buf)
2195 (setq buf (get-buffer-create buf)) 2197 (setq buf (get-buffer-create buf))
2196 (if (fboundp 'set-buffer-major-mode) 2198 (if (fboundp 'set-buffer-major-mode)
2197 (set-buffer-major-mode buf)) 2199 (set-buffer-major-mode buf))
@@ -2304,9 +2306,9 @@ If cursor is not at the end of the user input, move to end of input."
2304 ;; we don't want to change directory of current buffer. 2306 ;; we don't want to change directory of current buffer.
2305 (let ((default-directory ido-current-directory) 2307 (let ((default-directory ido-current-directory)
2306 (read-file-name-function nil)) 2308 (read-file-name-function nil))
2307 (run-hook-with-args 'ido-before-fallback-functions 2309 (setq this-command (or fallback 'find-file))
2308 (or fallback 'find-file)) 2310 (run-hook-with-args 'ido-before-fallback-functions this-command)
2309 (call-interactively (or fallback 'find-file)))) 2311 (call-interactively this-command)))
2310 2312
2311 ((eq ido-exit 'switch-to-buffer) 2313 ((eq ido-exit 'switch-to-buffer)
2312 (ido-buffer-internal ido-default-buffer-method nil nil nil ido-text)) 2314 (ido-buffer-internal ido-default-buffer-method nil nil nil ido-text))
@@ -2363,9 +2365,11 @@ If cursor is not at the end of the user input, move to end of input."
2363 ((eq method 'write) 2365 ((eq method 'write)
2364 (ido-record-work-file filename) 2366 (ido-record-work-file filename)
2365 (setq default-directory ido-current-directory) 2367 (setq default-directory ido-current-directory)
2366 (ido-record-command 'write-file (concat ido-current-directory filename)) 2368 (setq filename (concat ido-current-directory filename))
2369 (ido-record-command 'write-file filename)
2370 (add-to-history 'file-name-history filename)
2367 (ido-record-work-directory) 2371 (ido-record-work-directory)
2368 (write-file (concat ido-current-directory filename))) 2372 (write-file filename))
2369 2373
2370 ((eq method 'read-only) 2374 ((eq method 'read-only)
2371 (ido-record-work-file filename) 2375 (ido-record-work-file filename)
@@ -2381,6 +2385,7 @@ If cursor is not at the end of the user input, move to end of input."
2381 (ido-record-command 2385 (ido-record-command
2382 (if ido-find-literal 'insert-file-literally 'insert-file) 2386 (if ido-find-literal 'insert-file-literally 'insert-file)
2383 filename) 2387 filename)
2388 (add-to-history 'file-name-history filename)
2384 (ido-record-work-directory) 2389 (ido-record-work-directory)
2385 (insert-file-1 filename 2390 (insert-file-1 filename
2386 (if ido-find-literal 2391 (if ido-find-literal
@@ -2391,6 +2396,7 @@ If cursor is not at the end of the user input, move to end of input."
2391 (ido-record-work-file filename) 2396 (ido-record-work-file filename)
2392 (setq filename (concat ido-current-directory filename)) 2397 (setq filename (concat ido-current-directory filename))
2393 (ido-record-command 'find-file filename) 2398 (ido-record-command 'find-file filename)
2399 (add-to-history 'file-name-history filename)
2394 (ido-record-work-directory) 2400 (ido-record-work-directory)
2395 (ido-visit-buffer (find-file-noselect filename nil ido-find-literal) method)))))) 2401 (ido-visit-buffer (find-file-noselect filename nil ido-find-literal) method))))))
2396 2402