Closed meedstrom closed 3 months ago
Btw, I believe I'm missing something. I cannot seem to match postfixes either. Test example:
(let ((completion-extra-properties
(list :affixation-function
(lambda (coll)
(cl-loop for cand in coll
collect
(list cand "foo|| " " ||bar"))))))
(completing-read "Node: " (list "a" "b" "c" "d" "e" "aba" "bda" "ccd" "eeb" "feb")))
Typing &bar
matches nothing. Could you help me see?
Right now, Orderless only supports the annotation-function
provided by the completion table as part of its metadata.
Then I'm puzzled by the reference to :affixation-function here, what's it do? https://github.com/oantolin/orderless/blob/53f5204ad3f541e11eb6eeb9b86584964b7a3678/orderless.el#L307-320
Oh, you are right. It should actually work. The problem is that we first check for the completion metadata which may be nil.
EDIT: The problem was different. Fixed in https://github.com/oantolin/orderless/commit/4040f67949eab1cfca5bb52dca816f8f65955853.
Thanks! That'll be handy, it's all coming together.
BTW, I ran across a 2021 comment of yours https://github.com/minad/corfu/issues/38#issuecomment-883775437, and I wonder if you know about any recent developments? Or are affixations still king?
No, there hasn't been any progress regarding a more flexible annotation machinery.
In my package (org-node), I'm doing a completing-read command to match against Org subtrees. I have the full Org outline path included in each candidate. Like this:
Now one issue is that anything I type will match against any of the ancestor headings, which can be somewhat bothersome, so I'd like to move the ancestors into an affixation-function. But it'd be nice to be able to use Orderless'
&
to match against them when necessary.What do you think? Is there a particular reason to look up only the postfix?