help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using ido-completions in other packages


From: Thierry Volpiatto
Subject: Re: Using ido-completions in other packages
Date: Fri, 04 Jun 2010 15:14:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> Štěpán Němec <stepnem@gmail.com> writes:
>
>> Tassilo Horn <tassilo@member.fsf.org> writes:
>>
>
>> What I've been successfully using for some time is this, based on the
>> dysfunctional (for me, anyway) tip from the Emacs Wiki:
>>
>> <http://www.emacswiki.org/emacs/InteractivelyDoThings#toc12>
>
> That looks very nice thanks a lot, but I tried for example with
> senator-jump and it doesn't work.

I don't know what is senator-jump, but i guess this function use a
simple read-string. To have completion you need a *-completing-read with a
collection as arg.

I think a better approach to enable a ido-completing-read is what DVC
does:

,----
| (defun dvc-completing-read (&rest args)
|   "Read a string in the minibuffer, with completion.
| Set `dvc-completing-read-function' to determine which function to use.
| 
| See `completing-read' for a description of ARGS."
|   ;; Initialize dvc-completing-read-function on the first invocation of 
dvc-completing-read
|   ;; This allows to enable ido-mode after loading DVC
|   (when (eq dvc-completing-read-function 'auto)
|     (setq dvc-completing-read-function (if (and (boundp 'ido-mode) ido-mode)
|                                            'ido-completing-read
|                                          'completing-read)))
|   (apply dvc-completing-read-function args))
`----


> I guess that maybe not all the functions will use internally
> read-completion, is that correct?
Yes like read-string.

FYI you have also an anything implementation of completing-read that is
available in anything-config.el, it is called anything-comp-read.

-- 
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]