* minibuffer-completion-help, metadata and determining completions sort order
@ 2011-06-18 16:46 T. V. Raman
2011-06-18 17:23 ` Thierry Volpiatto
2011-06-18 20:03 ` Stefan Monnier
0 siblings, 2 replies; 8+ messages in thread
From: T. V. Raman @ 2011-06-18 16:46 UTC (permalink / raw
To: emacs-devel
I'm having a hard time understanding how one provides custom
metadata to completion-all-completions and friends. Also, looking
at the code in minibuffer-completions-help, I see that the
metadata can provide a custom sort function -- sounds
good. However the specific use case I want is the ability to not
sort the completions -- Ineed this for implementing Google
Suggest in the minibuffer. I had asked about this many moons ago
and Stefane had said that the code in minibuffer.el would be
changing to support this, assuming the metadata functionality is
to address that and other use cases? Anyway, I'd like the
ability to be able to set things up for Google Suggest so the
completions list goes through unmolested, and as things stand,
Isuppose I could provide a no-op sorter once I figure out to
supply the metadata; however that still feels wasteful since we
would end up traversing the list of completions for no reason ---
there is no option to avoid the sort call in minibuffer-completions-help
--
Best Regards,
--raman
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: minibuffer-completion-help, metadata and determining completions sort order
2011-06-18 16:46 minibuffer-completion-help, metadata and determining completions sort order T. V. Raman
@ 2011-06-18 17:23 ` Thierry Volpiatto
2011-06-18 20:03 ` Stefan Monnier
1 sibling, 0 replies; 8+ messages in thread
From: Thierry Volpiatto @ 2011-06-18 17:23 UTC (permalink / raw
To: emacs-devel
"T. V. Raman" <tv.raman.tv@gmail.com> writes:
> I'm having a hard time understanding how one provides custom
> metadata to completion-all-completions and friends. Also, looking
> at the code in minibuffer-completions-help, I see that the
> metadata can provide a custom sort function -- sounds
> good. However the specific use case I want is the ability to not
> sort the completions -- Ineed this for implementing Google
> Suggest in the minibuffer. I had asked about this many moons ago
> and Stefane had said that the code in minibuffer.el would be
> changing to support this, assuming the metadata functionality is
> to address that and other use cases? Anyway, I'd like the
> ability to be able to set things up for Google Suggest so the
> completions list goes through unmolested, and as things stand,
> Isuppose I could provide a no-op sorter once I figure out to
> supply the metadata; however that still feels wasteful since we
> would end up traversing the list of completions for no reason ---
> there is no option to avoid the sort call in minibuffer-completions-help
BTW Anything have already google suggestions.
--
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
^ permalink raw reply [flat|nested] 8+ messages in thread
* minibuffer-completion-help, metadata and determining completions sort order
@ 2011-06-18 20:01 raman
2011-06-18 20:15 ` Thierry Volpiatto
0 siblings, 1 reply; 8+ messages in thread
From: raman @ 2011-06-18 20:01 UTC (permalink / raw
To: Thierry Volpiatto, emacs-devel
-- Thierry Volpiatto <thierry.volpiatto@gmail.com> 10:23a
To: emacs-devel@gnu.org
TB> BTW Anything have already google suggestions.
What is "anything"?
Am having a hard time parsing your reply:-)
--
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
--
Best Regards,
--raman
--
Best Regards,
--raman
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: minibuffer-completion-help, metadata and determining completions sort order
2011-06-18 16:46 minibuffer-completion-help, metadata and determining completions sort order T. V. Raman
2011-06-18 17:23 ` Thierry Volpiatto
@ 2011-06-18 20:03 ` Stefan Monnier
2011-06-19 16:32 ` T.V. Raman
1 sibling, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2011-06-18 20:03 UTC (permalink / raw
To: tv.raman.tv; +Cc: emacs-devel
> I'm having a hard time understanding how one provides custom
> metadata to completion-all-completions and friends.
The completion table needs to provide the metadata.
> Isuppose I could provide a no-op sorter once I figure out to
> supply the metadata; however that still feels wasteful since we
If the sort function is `identity' it will leave this as-is.
> would end up traversing the list of completions for no reason ---
Why would you think it needs to traverse the list of completions?
[ Not that it would matter anyway, since the list has already been
traversed before and will be traversed again afterwards, any
potential slowdown should be negligible. ]
-- Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: minibuffer-completion-help, metadata and determining completions sort order
2011-06-18 20:01 raman
@ 2011-06-18 20:15 ` Thierry Volpiatto
0 siblings, 0 replies; 8+ messages in thread
From: Thierry Volpiatto @ 2011-06-18 20:15 UTC (permalink / raw
To: raman; +Cc: emacs-devel
raman <tv.raman.tv@gmail.com> writes:
> TB> BTW Anything have already google suggestions.
>
> What is "anything"?
Get the files here:
http://repo.or.cz/w/anything-config.git
Have infos here: (not updated)
http://www.emacswiki.org/emacs/Anything
The mailing list is here:
http://groups.google.com/group/emacs-anything?hl=en
or in gmane at gmane.emacs.anything
> Am having a hard time parsing your reply:-)
Sorry.;-)
--
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
^ permalink raw reply [flat|nested] 8+ messages in thread
* minibuffer-completion-help, metadata and determining completions sort order
2011-06-18 20:03 ` Stefan Monnier
@ 2011-06-19 16:32 ` T.V. Raman
2011-06-20 1:42 ` Stefan Monnier
0 siblings, 1 reply; 8+ messages in thread
From: T.V. Raman @ 2011-06-19 16:32 UTC (permalink / raw
To: Stefan Monnier, emacs-devel
Stefan, So the metadata gets placed as a property on the table?
Also I said the list would get traversed even if the sort
function was identity because the code does a funcall of the sort
function provided, but perhaps that's not a big issue. Some
examples on providing metadata would really help -- I've never
fully understood the completions code -- especially with respect
to the table and mode arguments.
--
Best Regards,
--raman
On 6/18/11, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> I'm having a hard time understanding how one provides custom
>> metadata to completion-all-completions and friends.
>
> The completion table needs to provide the metadata.
>
>> Isuppose I could provide a no-op sorter once I figure out to
>> supply the metadata; however that still feels wasteful since we
>
> If the sort function is `identity' it will leave this as-is.
>
>> would end up traversing the list of completions for no reason ---
>
> Why would you think it needs to traverse the list of completions?
> [ Not that it would matter anyway, since the list has already been
> traversed before and will be traversed again afterwards, any
> potential slowdown should be negligible. ]
>
>
> -- Stefan
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* minibuffer-completion-help, metadata and determining completions sort order
@ 2011-06-19 16:33 raman
0 siblings, 0 replies; 8+ messages in thread
From: raman @ 2011-06-19 16:33 UTC (permalink / raw
To: Stefan Monnier, emacs-devel
Stefan, So the metadata gets placed as a property on the table?
Also I said the list would get traversed even if the sort
function was identity because the code does a funcall of the sort
function provided, but perhaps that's not a big issue. Some
examples on providing metadata would really help -- I've never
fully understood the completions code -- especially with respect
to the table and mode arguments.
--
Best Regards,
--raman
--
Best Regards,
--raman
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: minibuffer-completion-help, metadata and determining completions sort order
2011-06-19 16:32 ` T.V. Raman
@ 2011-06-20 1:42 ` Stefan Monnier
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-06-20 1:42 UTC (permalink / raw
To: T.V. Raman; +Cc: emacs-devel
> Stefan, So the metadata gets placed as a property on the table?
No, the table has to be a function (completion tables can be
represented in many different ways: hash-table, obarray, list, alist,
and function).
Take a look at `completion-metadata' to see how the metadata
is extracted (the Lisp manual still doesn't have the corresponding
description :-( ).
> Also I said the list would get traversed even if the sort
> function was identity because the code does a funcall of the sort
> function provided, but perhaps that's not a big issue.
The "sort function" doesn't have to sort, it just takes a list and must
return a list, it can return the list it receives without looking at it,
as is the case if that function is `identity'.
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-06-20 1:42 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-18 16:46 minibuffer-completion-help, metadata and determining completions sort order T. V. Raman
2011-06-18 17:23 ` Thierry Volpiatto
2011-06-18 20:03 ` Stefan Monnier
2011-06-19 16:32 ` T.V. Raman
2011-06-20 1:42 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2011-06-18 20:01 raman
2011-06-18 20:15 ` Thierry Volpiatto
2011-06-19 16:33 raman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.