summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2010-12-01 17:34:09 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2010-12-01 17:34:09 -0500
commitbd794450721142e5774cb28ac534aa565d130001 (patch)
tree8d849114647b11639001296923b2c7ffc3e9d818
parent402c8a49571227f8a4e678d4a6cdd6ba7841aef9 (diff)
downloademacs-bd794450721142e5774cb28ac534aa565d130001.tar.gz
* lisp/ido.el (ido-common-initilization): New function.
(ido-mode): Use it. (ido-completing-read): Call it. Fixes: debbugs:3274
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/ido.el12
2 files changed, 14 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c6da166726b..12a1db25e0e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2010-12-01 Leo <sdl.web@gmail.com>
+
+ * ido.el (ido-common-initilization): New function. (bug#3274)
+ (ido-mode): Use it.
+ (ido-completing-read): Call it.
+
2010-11-27 Chong Yidong <cyd@stupidchicken.com>
* log-edit.el (log-edit-font-lock-keywords): Don't try matching
diff --git a/lisp/ido.el b/lisp/ido.el
index a4409775a86..ee8bd4961db 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1439,6 +1439,11 @@ Removes badly formatted data and ignored directories."
;; ido kill emacs hook
(ido-save-history))
+(defun ido-common-initilization ()
+ (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."
@@ -1482,12 +1487,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-initilization)
(ido-load-history)
(add-hook 'kill-emacs-hook 'ido-kill-emacs-hook)
@@ -4679,6 +4681,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-initilization)
(ido-read-internal 'list prompt hist def require-match initial-input)))
(defun ido-unload-function ()