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

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

Re: Help with completing-read


From: Stefan Monnier
Subject: Re: Help with completing-read
Date: Thu, 20 Jan 2011 14:19:30 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> The software I'm working on is doing this:
> (let ((completing-read-func (if (null ido-mode)
>                                   'completing-read
>                               'ido-completing-read)))
>     (setq ri-topic (or ri-topic
>                        (funcall completing-read-func
>                               "yari: "
>                               (yari-ruby-obarray rehash)
>                               nil
>                               t
>                               (yari-symbol-at-point)))))

> The obarray has a list of methods with their complete class path like 
> ActiveRecord::ConnectionAdapters::SchemaStatements#create_table

> What I'd like to be able to do is allow the user to just type
> create_table and then have a list of completions which would be the
> full class paths of for those classes that have a create_table method.

I'm not sure I understand the details of what you're asking for
(e.g. what part of the name do you want to list as completion, and where
do you want it to be listed).

Does ido-completing-read already do what you want?  If not, why not?
The default completion code provides a `substring' completion style in
Emacs-24 (not provided in Emacs-23) and it sounds close to what you
want, but OTOH ido-completing-read also provides it, so maybe you want
some else.

Or do you want something more like what filecache.el provides?


        Stefan


reply via email to

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