[Top][All Lists]

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

Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions accor

From: Dmitry Gutov
Subject: Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions according to match tightness
Date: Mon, 18 Mar 2019 02:38:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 17.03.2019 23:27, João Távora wrote:
[sorry for the double mail Dmitry]

No problem!

Yes, in this case it would come from company. I was thinking you
could sort by `completion-score` in descending order.

But why do it that way? And anyway, the capf sorting will be customizable by the user. company-capf will need to honor that.

But if you just want to try and see how well the sorting works, you can
add one to `company-transformers`.

Thanks, I added

(defun sort-by-company-score (cands)
   (cl-sort cands
            :key (lambda (cand) (or (get-text-property 0
'completion-score cand) 0)))

(add-to-list 'company-transformers 'sort-by-company-score)

And it behaves much better.

That's good.

My idea is that something like this could be
be built-in into company (after the lexicographical sort).

No need to hurry before Stefan here, I think.

reply via email to

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