-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
use affixation function? #9
Comments
We should support this as soon as Emacs 28 is released or earlier if Selectrum implements it earlier. |
I'm using two Emacsen, both are binaries of Emacs 28 prereleases: on Linux, I use the debian repository http://emacs.ganneff.de/; and on Windows I am using binaries from the emax64 project. Neither of the two seems to have affixation functions yet. |
Maybe it is not in master yet. Will it will ever be? See the discussion in https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00613.html. We could still chime into the discussion on emacs-devel if we have something to say. I have not followed upstream development, I do not know what is going on or planned. |
If we implement support for this at some point we should probably implement everything in the form of affixation functions, since it is potentially more efficient and if those are not yet supported, provide fallback annotation functions which call the affixation function. We could also do it the other way round if we do not care about the (minor) efficiency gains. Would probably be simpler since we don't have to do the loop all the time. And since we always annotate only 10 functions at once it is not that bad I guess. Only embark-occur will then be more costly, I suppose? |
The question is then how we would translate prefixes, maybe show them directly after the candidate if only annotation functions are supported. Or simply do not show them at all. I think prefixes are not super useful after having worked a while on marginalia. Only very small annotations could go in front, icons etc. Or the modifier/symbol-class in marginalia-annotate-variable/marginalia-annotate-symbol. |
Yes, I know it is. I'm just saying that probably only people who compile from source have it already. I'm using to regularly updated sources for binaries and they don't affixations yet.
You mean in addition to the annotations, right? You still want to support Emacs <28 for a while, I would assume. |
Right now it does not make sense to implement it. But as soon as some Emacs 28 versions with it become more widely available we can do it. Or when selectrum adds support for example. But I am not sure if selectrum can add support if the underlying emacs does not yet.
Yes, as I described above I would just support one form of annotations in marginalia and then depending on what is available translate to affixation or annotation functions. |
Sorry, I think I read too fast and missed that. I agree with defining affixations first and then annotations in terms of them. As for Embark Occur, I'd switch it over to affixations too. |
@oantolin Selectrum already added affixation-function support. It didn't take long thanks to @clemera 😀 See radian-software/selectrum#271 I will prepare a prototype. |
I implemented preliminary support, see ef4fabf. In case we want to add prefixes or optimize this, we should express everything in terms of affixations instead. But for now this is good enough and ensures that our marginalia annotations take precedence over the Emacs 28 or selectrum affixations. For "keyhole" completion-systems like icomplete and selectrum the optimization would not play a role, but it could play a role for live-occur of Embark. |
Just to keep this in mind for the future. Moved here from minad/consult#5
The text was updated successfully, but these errors were encountered: