Stefan Reichör <[EMAIL PROTECTED]> writes:

> Stephen Leake <[EMAIL PROTECTED]> writes:
>
>> Michael Olson <[EMAIL PROTECTED]> writes:
>>
>>> Stephen Leake <[EMAIL PROTECTED]> writes:
>>>
>>>> ido-completing-read appears to be broken as called from
>>>> dvc-current-active-dvc.
>>>>
>>>> Try this:
>>>>
>>>> (ido-completing-read "back-end: " '("bzr" "xmtn"))
>>>
>>> That should be:
>>>
>>> (ido-completing-read "back-end: " '(("bzr") ("xmtn")))
>>>
>
> Both variants should work. And they work on my system.
>
> There is a problem with ido-mode. ido-completing-read does only work,
> when ido-mode is initialized somehow.
>
> I use the following in my .emacs:
>
> (ido-mode 'buffer)
> (setq ido-enable-flex-matching t)

Ok. Initializing ido-mode fixes ido-completing-read for me.

This seems like a bug in ido; ido-completing-read should use
completing-read if ido-mode is nil.

We could work around that bug in dvc with a wrapper around
ido-completing-read.

Or we could just make the default for dvc-completing-read-function be
'completing-read, on the assumption that people who set it to
ido-completing-read will have initialized ido.

>> In any case, ido-completing-read is still broken for me in Emacs 22 (I
>> haven't tested it in Emacs 21).
>
> See my initialization code above to make ido-completing work for you.
>
> I really like the ido-completion much more than the standard
> completion mechanism. This is the reason why I introduced a
> package-completing-read variable in almost all of my packages.
> So it is no compatibility setting. It is a setting that should allow a
> better user experience.
>
> I asked Kim F. Storm (the author of ido-mode) if he could fix the
> initialization problem of ido-completing-read. 

Ok. I'll change the default of dvc-completing-read to
'completing-read, with a note about needing to initialize ido.

Hmm. Perhaps a more friendly default would be :

(if ido-mode 'ido-completing-read 'completing-read)

> He agreed that there is a bug but he also mentioned that this bug is
> hard to fix.

(defun ido-completing-read (args)
    (if ido-mode
        (ido-completing-read-1 args)
      (completing-read args)))

seems simple enough?

There is still another bug; ido-completing-read can't handle '((bzr
"path") (xmtn "path")) for the choices argument, while completing-read
can (it calls symbol-name on the symbols). I can work around that in
dvc-current-active-dvc. Could you ask Kim if he's aware of this bug,
or should I just report it on emacs-bug?

-- 
-- Stephe

_______________________________________________
Dvc-dev mailing list
[email protected]
https://mail.gna.org/listinfo/dvc-dev

Reply via email to