From bd794450721142e5774cb28ac534aa565d130001 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Wed, 1 Dec 2010 17:34:09 -0500 Subject: * lisp/ido.el (ido-common-initilization): New function. (ido-mode): Use it. (ido-completing-read): Call it. Fixes: debbugs:3274 --- lisp/ido.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lisp/ido.el') 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 () -- cgit v1.2.1 From 0fdd1db7fd278b6ac13f2f2709940b04e16a492c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 1 Dec 2010 23:40:32 -0800 Subject: That's not how you spell "initialization". --- lisp/ido.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp/ido.el') diff --git a/lisp/ido.el b/lisp/ido.el index ee8bd4961db..52661d9cf49 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1439,7 +1439,7 @@ Removes badly formatted data and ignored directories." ;; ido kill emacs hook (ido-save-history)) -(defun ido-common-initilization () +(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)) @@ -1489,7 +1489,7 @@ This function also adds a hook to the minibuffer." (ido-everywhere (if ido-everywhere 1 -1)) (when ido-mode - (ido-common-initilization) + (ido-common-initialization) (ido-load-history) (add-hook 'kill-emacs-hook 'ido-kill-emacs-hook) @@ -4682,7 +4682,7 @@ DEF, if non-nil, is the default value." (ido-context-switch-command 'ignore) (ido-choice-list choices)) ;; Initialize ido before invoking ido-read-internal - (ido-common-initilization) + (ido-common-initialization) (ido-read-internal 'list prompt hist def require-match initial-input))) (defun ido-unload-function () -- cgit v1.2.1