[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sorting Order of Completion Candidates
From: |
Florian Beck |
Subject: |
Re: Sorting Order of Completion Candidates |
Date: |
Tue, 01 Mar 2011 19:22:47 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
On 03/01/2011 05:29 PM, Ted Zlatanov wrote:
Florian: I've proposed a patch to use the string property
:completion-score to attach a numerical score to the completion
candidates. The discussion so far is in the BBDB mailing list (where we
needed to score completion candidates) but I will propose it on
emacs-devel once Stefan reviews it.
Nice idea. You mean text properties on the strings?
So I would use something like
(defun string-score-higher (a b)
(if (> (or (get-text-property 0 :completion-score a) 0)
(or (get-text-property 0 :completion-score b) 0))
a
(string-lessp a b)))
as a sorting predicate?
Seems to work (so far),
Thanks,
Florian
- Re: Sorting Order of Completion Candidates, Florian Beck, 2011/03/01
- Re: Sorting Order of Completion Candidates, Stefan Monnier, 2011/03/03
- Re: Sorting Order of Completion Candidates, Ted Zlatanov, 2011/03/04
- Re: Sorting Order of Completion Candidates, Stefan Monnier, 2011/03/05
- Re: Sorting Order of Completion Candidates, Ted Zlatanov, 2011/03/07
- Re: Sorting Order of Completion Candidates, Stefan Monnier, 2011/03/07
- Re: Sorting Order of Completion Candidates, Ted Zlatanov, 2011/03/08