-
Notifications
You must be signed in to change notification settings - Fork 9
feat: migrate to newer notmuch_database_open_with_config #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
feat: migrate to newer notmuch_database_open_with_config #27
Conversation
notmuch_database_open is deprecated since notmuch version 0.32 Version checks ensure backwards compatibility with older notmuch versions is preserved.
|
Thank you @anonymousgrasshopper for this, it's a solid start. I left some review comments to run the version check only once and cache it, and a few more nitpicks here and there. |
|
We can perhaps add a config option to do that, so that we can just use the value in the user's config if it exists and else detect it and cache it in the config. This way if someone uses an old notmuch version and doesn't want to/can't update, and are tired of seeing the |
Do you mean that the users should keep their I don't mind the That way the message will get across to the user, but not too aggressively where it gets tedious. |
|
@anonymousgrasshopper BTW, I pushed to Let me know if you're fine with this to be merged if you want to test it first. |
Previously checked notmuch version on every database open. Now detect once at module initialization and cache the result, reducing subprocess spawns to only 1 per session
|
You checked for version |
Oops my bad !! 🫣 I left that by accident when I was testing. I'll remove that when I merge.
When |
|
Merged to |
I meant if I open neovim, run the |
See #24.
notmuch_database_open is deprecated since notmuch version 0.32
Using
vim.system({ "notmuch", "--version" })gives access to the installed notmuch version. We can then check that it is greater than or equal to 0.32 to ensure backwards compatibility with older notmuch versions is preserved.I have only tested this on notmuch 0.39; installing a pre-0.32 version to check it then uses the old api would be a good idea.
closes #24