To manually test, execute this:
(defun actest-value-candidates ()
;; (name . value) -- see `ac-candidates-1'
'(("foofoo" . "foo")
("foobar" . "bar")))
'((candidates . (actest-value-candidates))))
(pop-to-buffer (get-buffer-create "*actest*"))
(run-with-timer 0.1 nil #'auto-complete '(ac-source-actest-keywords)))
Treat popup value property in ac-selected-candidate
Refactor ac-candidates: clarify what it returns
Treat popup value property in ac-candidates
Wait sec, I am not sure about the last commit tkf@06acf91
Add ac-test-candidates-in-cons-format (failing)
Fix ac-candidates; the previously added test passes now
The fix I've done in 06acf91 is
not right -- I need to apply popup-item-value-or-self before
computing common part.
Make cons-format tests more evil (2 failures)
Use popup value property when matching candidates; tests pass
I think this PR is ready for merge. But I want @m2ym to review it as it is a little bit large change. My concern is that the change in ac-candidates-1 (tkf@e256d26) might slows down completion as it creates a list as long as candidates every time. We can avoid this by adding "I don't use popup-item-value" flag as source attribute. Probably we should make it default.
@tjarvstrand, @jixiuf, as your issue reports (#168, #148) are fixed by this PR, feel free to try/review this.
Why you use popup-item-value-or-self here? The item value can be any type of object. Maybe we should convert the item value into string for safe.
Fixed in 6d6a8e2
Matching againt the candidate values seems to be wrong, to me. Isearch will be inconsistent for example.
This change is necessary to make the failing tests in the previous change set (85eddcf) pass. What you said is true only if the popup item is prefix of popup item value property (This is not the case in the previous change set). Otherwise, AC fails to match candidates.
Convert popup value to string when matching
See @m2ym's comment on e256d26
Convert popup item value to string in ac-candidates
Any progress on this? I'm sorry I haven't had the time to try this out, but I'll try to get around to it soon. :)
Treat popup value property when completing candidate
This is same as #185
I have merged this patch. Please report us if there are any problems.
Sorry I revert this changes. This patch breaks auto-complete source whose candidates type
is cons such as ac-semantic-candidates. Because cdr value is set as value property
in candidate string.
This changes should apply only to popup-item object. But it is only a propertized string.
so we can't make a distinction between popup-item and normal propertized string.
Because popup-item may not have its specific property, such as popup-face.