summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-12-13 10:27:36 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2010-12-13 10:27:36 -0500
commitf49d1f52b2e368ef67dcfececd426de958548f4e (patch)
treece24ced92f2acc976daf4b69e3634c8bd600e44e /lisp/ido.el
parent07176b2a9e63a0d3933b167f987475d8a18da5cc (diff)
parent11aad4e9f9f54ce8e9ecc66347e512b20a3cdf39 (diff)
downloademacs-f49d1f52b2e368ef67dcfececd426de958548f4e.tar.gz
Merge from emacs-23
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index 2df9b8666af..306485de1ad 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1467,6 +1467,11 @@ Removes badly formatted data and ignored directories."
;; ido kill emacs hook
(ido-save-history))
+(defun ido-common-initialization ()
+ (ido-init-completion-maps)
+ (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
+ (add-hook 'choose-completion-string-functions 'ido-choose-completion-string))
+
(define-minor-mode ido-everywhere
"Toggle using ido speed-ups everywhere file and directory names are read.
With ARG, turn ido speed-up on if arg is positive, off otherwise."
@@ -1510,12 +1515,9 @@ This function also adds a hook to the minibuffer."
(t nil)))
(ido-everywhere (if ido-everywhere 1 -1))
- (when ido-mode
- (ido-init-completion-maps))
(when ido-mode
- (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
- (add-hook 'choose-completion-string-functions 'ido-choose-completion-string)
+ (ido-common-initialization)
(ido-load-history)
(add-hook 'kill-emacs-hook 'ido-kill-emacs-hook)
@@ -4759,6 +4761,8 @@ DEF, if non-nil, is the default value."
(ido-directory-too-big nil)
(ido-context-switch-command 'ignore)
(ido-choice-list choices))
+ ;; Initialize ido before invoking ido-read-internal
+ (ido-common-initialization)
(ido-read-internal 'list prompt hist def require-match initial-input)))
(defun ido-unload-function ()