changeset 111886:8e856214e6e5

* lisp/ido.el (ido-common-initilization): New function. (ido-mode): Use it. (ido-completing-read): Call it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 01 Dec 2010 17:34:09 -0500
parents 154433017097
children 0eb10986b8f2
files lisp/ChangeLog lisp/ido.el
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Nov 27 14:41:49 2010 -0500
+++ b/lisp/ChangeLog	Wed Dec 01 17:34:09 2010 -0500
@@ -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
--- a/lisp/ido.el	Sat Nov 27 14:41:49 2010 -0500
+++ b/lisp/ido.el	Wed Dec 01 17:34:09 2010 -0500
@@ -1439,6 +1439,11 @@
   ;; 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 @@
 	 (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 @@
 	(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 ()