From 76e8d1e6ded9b638ce9ea5b172e61d6806a943ef Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 16 Dec 2012 15:25:14 +0200 Subject: [PATCH] * add --skip-msgid-dups / -u option to mu find, document it --- man/mu-find.1 | 9 ++++++++- mu/mu-cmd-find.c | 2 ++ mu/mu-config.c | 4 ++++ mu/mu-config.h | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/man/mu-find.1 b/man/mu-find.1 index 7ec61e71..b89b6f3b 100644 --- a/man/mu-find.1 +++ b/man/mu-find.1 @@ -1,4 +1,4 @@ -.TH MU FIND 1 "October 2012" "User Manuals" +.TH MU FIND 1 "December 2012" "User Manuals" .SH NAME @@ -427,6 +427,13 @@ use a bookmarked search query. Using this option, a query from your bookmark file will be prepended to other search queries. See mu-bookmarks(1) for the details of the bookmarks file. + +.TP +\fB\-\-no\-msgid\-dups\fR +whenever there are multiple messages with the same name, only show the first +one. This is useful if you have copies of the same message, which is a common +occurence when using e.g. Gmail together with \fBofflineimap\fR. + .TP \fB\-t\fR, \fB\-\-threads\fR show messages in 'threaded' format -- that is, with indentation and arrows diff --git a/mu/mu-cmd-find.c b/mu/mu-cmd-find.c index 6f1b5267..a7d84179 100644 --- a/mu/mu-cmd-find.c +++ b/mu/mu-cmd-find.c @@ -127,6 +127,8 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts, GError **err) qflags |= MU_QUERY_FLAG_THREADS; if (opts->reverse) qflags |= MU_QUERY_FLAG_DESCENDING; + if (opts->no_msgid_dups) + qflags |= MU_QUERY_FLAG_SKIP_MSGID_DUPS; iter = mu_query_run (xapian, query, sortid, -1, qflags, err); return iter; diff --git a/mu/mu-config.c b/mu/mu-config.c index 91a3e629..1c625e9b 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -213,6 +213,10 @@ config_options_group_find (void) "use a bookmarked query", ""}, {"reverse", 'z', 0, G_OPTION_ARG_NONE, &MU_CONFIG.reverse, "sort in reverse (descending) order (z -> a)", NULL}, + {"no-msgid-dups", 'u', 0, G_OPTION_ARG_NONE, + &MU_CONFIG.no_msgid_dups, + "only show the first of multiple messages with the same " + "message-id (false)", NULL}, {"linksdir", 0, 0, G_OPTION_ARG_STRING, &MU_CONFIG.linksdir, "output as symbolic links to a target maildir", ""}, {"clearlinks", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.clearlinks, diff --git a/mu/mu-config.h b/mu/mu-config.h index 0bf69179..f80e4d4f 100644 --- a/mu/mu-config.h +++ b/mu/mu-config.h @@ -139,6 +139,10 @@ struct _MuConfig { gchar *exec; /* command to execute on the * files for the matched * messages */ + gboolean no_msgid_dups; /* if there are multiple + * messages with the same + * msgid, show only the first + * one */ /* for find and cind */ time_t after; /* only show messages or * adresses last seen after