astroid icon indicating copy to clipboard operation
astroid copied to clipboard

Incompatible with notmuch v0.32 `database.mail_root` config

Open OJFord opened this issue 3 years ago • 1 comments

The database.mail_root config option of notmuch allows storing the notmuch indices (database.path) separately to the source directories.

By default, it falls back on database.path for backwards-compatibility, but if set astroid is unable to view threads, since it tries to load ${database.path}/${path to eml} instead of ${database.mail_root}/${path to eml} where it is actually located.

Somewhat relatedly, notmuch has defaults but astroid requires (almost all of) them to be explicitly set in config. If astroid used notmuch config get database.mail_root, then it would not be necessary to re-implement notmuch's fallback (or environment variables, etc.). It would also avoid the need to specify notmuch config location in astroid config, even when a location on notmuch's default search path is used.

OJFord avatar Jul 20 '21 13:07 OJFord

This is due to use of notmuch_database_open, rather than the new notmuch_database_open_with_config, some more detail in vhdirk/notmuch-rs#34, but essentially the former is stuck with ignoring config in order to provide a compatible upgrade path, (so explained D. Bremner on IRC) and as a result mail_root can't be specified and is assumed to equal db_path.

OJFord avatar Jul 26 '21 03:07 OJFord