Stephen Leake <[EMAIL PROTECTED]> writes:

>> completing-read on Emacs21 will also complain if each of these
>> elements are not lists in themselves.
>
> So we have a version incompatibility. Sigh. The actual use in
> dvc-current-active-dvc is Emacs 21 compatible, fortunately.
>
> (Aside; given the other thread on compatibility, does this mean we
> should have dvc-completing-read reimplement completing-read? I hope
> not :)

No need.  That would be overkill.

> (Aside 2: it would be nice if ido provided a way to choose either ido
> or the standard completing-read itself, so we don't have to)

ido is by no means a standard yet: people still have different ideas
about which completion package is better, and there are several.  Hence
why it is a good idea to let the user decide with a customizable option
that defaults to the one we developers think best.

> (Aside 3: Since this was introduced as part of a cleanup for XEmacs, I
> gather XEmacs doesn't have ido, so dvc-completing-read is provided
> really as an XEmacs compatibility function? If so, it belongs in
> dvc-xemacs.el).

Not really, for the reason listed above.

> In any case, ido-completing-read is still broken for me in Emacs 22 (I
> haven't tested it in Emacs 21).
>
> The behavior I'm seeing:
>
> Invoke the above (either version).
>
> Type 'b' <RET>
>
>     The minibuffer shows two lines, the first containing the prompt,
>     the second a blank line.

I get "bzr" in the modeline, with Emacs 23.0.50.2.

But with emacs22, I do see the problem you describe.  Weird.

> If I run
>
> (completing-read "back-end: " '(("bzr") ("xmtn")))
>
> I get "b" as the result after typing <RET>
>
> I'm running:
>
>     GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE.

Yep, that happens with Emacs 23.0.50.2 as well.  It's expected that the
user will hit TAB first, then RET.

One possibility would be to make this function, based on comments in the
header of iswitchb.el:

(defun dvc-icompleting-read (prompt choices)
  "Use iswitch as a completing-read replacement to choose from
choices.  PROMPT is a string to prompt with.  CHOICES is a list of
strings to choose from."
  (require 'iswitchb)
  (let ((iswitchb-make-buflist-hook
         (lambda ()
           (setq iswitchb-temp-buflist choices))))
    (iswitchb-read-buffer prompt)))

It doesn't work with XEmacs 21.4, XEmacs 21.5 beta, or Emacs 21, though,
so we'd have to default to using it (by modifying the default value of
dvc-completing-read-function) if (and (not (featurep 'xemacs)) (=
emacs-major-version 22))

If emacs-major-version is 23, use ido, and if 21, use completing-read.

-- 
       Michael Olson -- FSF Associate Member #652     |
 http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net  |  /` |\ | | |
          Programmer -- Hobbies: Lisp, HCoop          | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |

Attachment: pgpWSRIOTZVCK.pgp
Description: PGP signature

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

Reply via email to