unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: 3274@debbugs.gnu.org
Cc: Daniel Colascione <dan.colascione@gmail.com>
Subject: bug#3274: ido-completing-read doesn't work unless ido-mode is executed
Date: Sun, 28 Nov 2010 13:53:26 +0000	[thread overview]
Message-ID: <m1wrnxmu5l.fsf@cam.ac.uk> (raw)
In-Reply-To: <m14ob1o9ga.fsf@cam.ac.uk> (Leo's message of "Sun, 28 Nov 2010 13:37:41 +0000")

On 2010-11-28 13:37 +0000, Leo wrote:
> I also ran into this bug a while back but didn't stop to fix it.
>
> Could you verify the following patch fixes the bug?

Please consider this patch instead. While the previous fix is minimal it
does a bit too much by calling (ido-mode 1).

commit eb3f3a514c7ebd2db402ca8c2f3ce7088dd8736a (HEAD, refs/heads/Ferrari)
Date:   Sun Nov 28 13:32:44 2010 +0000

    Fix initialisation in ido-completing-read (#3274)

	Modified lisp/ido.el
diff --git a/lisp/ido.el b/lisp/ido.el
index 70d2d98..2cc10b2 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1490,6 +1490,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."
@@ -1533,12 +1538,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)
@@ -4853,6 +4855,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 ()






  reply	other threads:[~2010-11-28 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 15:10 bug#3274: ido-completing-read doesn't work unless ido-mode is executed Daniel Colascione
2010-11-28 13:37 ` Leo
2010-11-28 13:53   ` Leo [this message]
2010-11-28 20:50     ` Stefan Monnier
2010-12-02 23:05       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1wrnxmu5l.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=3274@debbugs.gnu.org \
    --cc=dan.colascione@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).