-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support affixation-function metadata #240
Comments
Not sure what you mean by that. How can you use the |
The |
I've missed a lot of the conversation surrounding this, but why would you use the annotations to get properties instead of just using |
@minad Hm, how can this can be used to improve the situation for returning propertized strings, I would assume the selected candidate is still returned from |
@okamsn As far as I understood it this will only work partially because the properties are only added to the part you completed within the minibuffer and if you type the string manually you won't get any properties. |
the problem is if there are duplicate candidates with different properties. this happens for example for the swiper-like consult-line. two different lines with the same text could then get two different line numbers.
This issue has nothing to do with what is returned from completing read. The goal here is only to associate prefixes and suffixes with the candidates. I am doing this right now using the 'display hack. |
Okay, I misunderstood your initial comment I get it now. |
Added in #271 |
In emacs 28 there is affixation-function which allows prefix/suffix annotations it seems. See emacs-mirror/emacs@3b74059 and minad/consult#5.
@clemera @raxod502 If you are interested I can provide a patch for selectrum. This could be helpful for consult. But I have to think, the problem is again the alist lookup for duplicate candidates. Maybe properties are allowed for the annotation-function/affixation-function (It is different from having the annotation on the return value, where the return value might not originate from the candidate set if the user wrote it by hand). Then the affixation-function could simply return the associated properties. This would result in a bit of an unnecessary going back and forth but if it works...
The text was updated successfully, but these errors were encountered: