* [PATCH] config: read database.path from $MAILDIR if set
@ 2014-07-21 23:05 Mark Oteiza
2014-07-31 10:10 ` David Bremner
2014-07-31 10:17 ` David Bremner
0 siblings, 2 replies; 4+ messages in thread
From: Mark Oteiza @ 2014-07-21 23:05 UTC (permalink / raw)
To: notmuch
Try to read the config parameter database.path from $MAILDIR before
falling back to $HOME/mail
---
In the same vein as the $NAME patch, it would also be nice to configure
the maildir location for notmuch with one's environment. Just from a
brief perusing, I see that $MAILDIR is used at least by Gnus, procmail,
GNU mailutils, and mutt.
Another thing that might be nice is tilde expantion for database.path,
but that's more complicated :)
notmuch-config.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/notmuch-config.c b/notmuch-config.c
index 8f1f48d..88831e2 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -217,7 +217,7 @@ get_username_from_passwd_file (void *ctx)
* These default configuration settings are determined as
* follows:
*
- * database_path: $HOME/mail
+ * database_path: $MAILDIR, otherwise $HOME/mail
*
* user_name: $NAME variable if set, otherwise
* read from /etc/passwd
@@ -323,8 +323,10 @@ notmuch_config_open (void *ctx,
if (notmuch_config_get_database_path (config) == NULL) {
- char *path = talloc_asprintf (config, "%s/mail",
- getenv ("HOME"));
+ char *path = getenv ("MAILDIR");
+ if (! path)
+ path = talloc_asprintf (config, "%s/mail",
+ getenv ("HOME"));
notmuch_config_set_database_path (config, path);
talloc_free (path);
}
--
2.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-31 10:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-21 23:05 [PATCH] config: read database.path from $MAILDIR if set Mark Oteiza
2014-07-31 10:10 ` David Bremner
2014-07-31 10:14 ` David Bremner
2014-07-31 10:17 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).