* add basic implementation for bookmark support.

basically, add a file named ~/.mu/bookmarks which looks something like
  ----
  [mu]
  testarch=subject:test maildir:/archive
  inbox=maildir:/inbox
  ----

  now, one can do a query, e.g.

    mu find -b testarch

  which is equivalend to

    mu find subject:test maildir:/archive

 if both a bookmark and a 'normal' search expression are specified,
 the will be concatenated.

 bookmarks starting with mu_ are reserved for mu itself.
This commit is contained in:
Dirk-Jan C. Binnema
2010-11-13 14:16:38 +02:00
parent be9157f3e9
commit 3794182e05
6 changed files with 124 additions and 51 deletions

View File

@ -194,7 +194,6 @@ mu_util_guess_mu_homedir (void)
".mu");
}
gchar*
mu_util_guess_xapian_dir (const char* muhome)
{
@ -208,6 +207,19 @@ mu_util_guess_xapian_dir (const char* muhome)
return xdir;
}
gchar*
mu_util_guess_bookmark_file (const char* muhome)
{
gchar *homedir, *bmpath;
homedir = muhome ? g_strdup(muhome) : mu_util_guess_mu_homedir ();
bmpath = g_strdup_printf ("%s%c%s", homedir, G_DIR_SEPARATOR,
MU_BOOKMARK_FILENAME);
g_free (homedir);
return bmpath;
}
gboolean
mu_util_create_dir_maybe (const gchar *path)