881 |
:type '(repeat symbol) |
:type '(repeat symbol) |
882 |
:group 'ido) |
:group 'ido) |
883 |
|
|
884 |
|
(defcustom ido-before-fallback-functions '() |
885 |
|
"List of functions to call before calling a fallback command. |
886 |
|
The fallback command is passed as an argument to the functions." |
887 |
|
:type 'hook |
888 |
|
:group 'ido) |
889 |
|
|
890 |
;;; Internal Variables |
;;; Internal Variables |
891 |
|
|
892 |
;; Persistent variables |
;; Persistent variables |
1924 |
(defun ido-buffer-internal (method &optional fallback prompt default initial switch-cmd) |
(defun ido-buffer-internal (method &optional fallback prompt default initial switch-cmd) |
1925 |
;; Internal function for ido-switch-buffer and friends |
;; Internal function for ido-switch-buffer and friends |
1926 |
(if (not ido-mode) |
(if (not ido-mode) |
1927 |
(call-interactively (or fallback 'switch-to-buffer)) |
(progn |
1928 |
|
(run-hook-with-args 'ido-before-fallback-functions |
1929 |
|
(or fallback 'switch-to-buffer)) |
1930 |
|
(call-interactively (or fallback 'switch-to-buffer))) |
1931 |
(let* ((ido-context-switch-command switch-cmd) |
(let* ((ido-context-switch-command switch-cmd) |
1932 |
(ido-current-directory nil) |
(ido-current-directory nil) |
1933 |
(ido-directory-nonreadable nil) |
(ido-directory-nonreadable nil) |
1946 |
|
|
1947 |
((eq ido-exit 'fallback) |
((eq ido-exit 'fallback) |
1948 |
(let ((read-buffer-function nil)) |
(let ((read-buffer-function nil)) |
1949 |
|
(run-hook-with-args 'ido-before-fallback-functions |
1950 |
|
(or fallback 'switch-to-buffer)) |
1951 |
(call-interactively (or fallback 'switch-to-buffer)))) |
(call-interactively (or fallback 'switch-to-buffer)))) |
1952 |
|
|
1953 |
;; Check buf is non-nil. |
;; Check buf is non-nil. |
2079 |
;; we don't want to change directory of current buffer. |
;; we don't want to change directory of current buffer. |
2080 |
(let ((default-directory ido-current-directory) |
(let ((default-directory ido-current-directory) |
2081 |
(read-file-name-function nil)) |
(read-file-name-function nil)) |
2082 |
|
(run-hook-with-args 'ido-before-fallback-functions |
2083 |
|
(or fallback 'find-file)) |
2084 |
(call-interactively (or fallback 'find-file)))) |
(call-interactively (or fallback 'find-file)))) |
2085 |
|
|
2086 |
((eq ido-exit 'switch-to-buffer) |
((eq ido-exit 'switch-to-buffer) |
2147 |
(setq filename (concat ido-current-directory filename)) |
(setq filename (concat ido-current-directory filename)) |
2148 |
(ido-record-command fallback filename) |
(ido-record-command fallback filename) |
2149 |
(ido-record-work-directory) |
(ido-record-work-directory) |
2150 |
|
(run-hook-with-args 'ido-before-fallback-functions fallback) |
2151 |
(funcall fallback filename)) |
(funcall fallback filename)) |
2152 |
|
|
2153 |
((eq method 'insert) |
((eq method 'insert) |
4224 |
(buf (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match))) |
(buf (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match))) |
4225 |
(if (eq ido-exit 'fallback) |
(if (eq ido-exit 'fallback) |
4226 |
(let ((read-buffer-function nil)) |
(let ((read-buffer-function nil)) |
4227 |
|
(run-hook-with-args 'ido-before-fallback-functions 'read-buffer) |
4228 |
(read-buffer prompt default require-match)) |
(read-buffer prompt default require-match)) |
4229 |
buf))) |
buf))) |
4230 |
|
|
4271 |
(setq filename 'fallback))) |
(setq filename 'fallback))) |
4272 |
(if (eq filename 'fallback) |
(if (eq filename 'fallback) |
4273 |
(let ((read-file-name-function nil)) |
(let ((read-file-name-function nil)) |
4274 |
|
(run-hook-with-args 'ido-before-fallback-functions 'read-file-name) |
4275 |
(read-file-name prompt dir default-filename mustmatch initial predicate)) |
(read-file-name prompt dir default-filename mustmatch initial predicate)) |
4276 |
filename))) |
filename))) |
4277 |
|
|