diff --git a/man/mu-find.1 b/man/mu-find.1 index 53e23954..cc0e69ac 100644 --- a/man/mu-find.1 +++ b/man/mu-find.1 @@ -42,7 +42,7 @@ The search pattern is taken as a command-line parameter. If the search parameter consists of multiple parts (as in the example) they are treated as if there were a logical \fBand\fR between them. -For details on the possible queries, see +For details on the possible queries, see @@ -209,17 +209,17 @@ details of the bookmarks file. .TP -\fB\-\-skip\-dups\fR,\fB-u\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 occurrence when using e.g. Gmail together with -\fBofflineimap\fR. +\fB\-\-include\-dups\fR,\fB-u\fR by default, 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 occurrence when using e.g. Gmail +together with \fBofflineimap\fR. Use this option to turn that behavior off. .TP -\fB\-\-include\-related\fR,\fB-r\fR also include messages being refered to by -the matched messages -- i.e.. include messages that are part of the same -message thread as some matched messages. This is useful if you want -Gmail-style 'conversations'. Note, finding these related messages make -searches slower. +\fB\-\-skip\-related\fR,\fB-r\fR by default, the results include messages being +refered to by the matched messages -- i.e.. include messages that are part of +the same message thread as some matched messages. This is useful if you want +Gmail-style 'conversations'. Note, finding these related messages make searches +slightly slower. Use this option to turn that behavior off. .TP \fB\-t\fR, \fB\-\-threads\fR show messages in a 'threaded' format -- that is, diff --git a/mu/mu-cmd-find.c b/mu/mu-cmd-find.c index bf3e55e7..d5e7320d 100644 --- a/mu/mu-cmd-find.c +++ b/mu/mu-cmd-find.c @@ -130,9 +130,9 @@ run_query (MuQuery *xapian, const gchar *query, MuConfig *opts, GError **err) qflags = MU_QUERY_FLAG_NONE; if (opts->reverse) qflags |= MU_QUERY_FLAG_DESCENDING; - if (opts->skip_dups) + if (!opts->include_dups) qflags |= MU_QUERY_FLAG_SKIP_DUPS; - if (opts->include_related) + if (!opts->skip_related) qflags |= MU_QUERY_FLAG_INCLUDE_RELATED; if (opts->threads) qflags |= MU_QUERY_FLAG_THREADS; diff --git a/mu/mu-config.c b/mu/mu-config.c index 3f1b4051..839a1a04 100644 --- a/mu/mu-config.c +++ b/mu/mu-config.c @@ -211,12 +211,24 @@ 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}, - {"skip-dups", 'u', 0, G_OPTION_ARG_NONE, - &MU_CONFIG.skip_dups, + /* default is to skip dups (messages with the same message-id); + * option left for backward compatibility */ + {"skip-dups", 'u', G_OPTION_FLAG_HIDDEN|G_OPTION_FLAG_REVERSE, + G_OPTION_ARG_NONE, &MU_CONFIG.include_dups, "show only the first of messages duplicates (false)", NULL}, - {"include-related", 'r', 0, G_OPTION_ARG_NONE, - &MU_CONFIG.include_related, - "include related messages in results (false)", NULL}, + {"include-dups", 'u', 0, G_OPTION_ARG_NONE, + &MU_CONFIG.include_dups, + "do not skip all but the first message with some message-id", + NULL}, + /* default is to include related messages; option left for + * backward compatibility */ + {"include-related", 'r', G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_REVERSE, + G_OPTION_ARG_NONE, &MU_CONFIG.skip_related, + "include related messages in results", NULL}, + {"skip-related", 'r', 0, G_OPTION_ARG_NONE, + &MU_CONFIG.skip_related, + "do not include related messages in the results (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 932b58fd..5cbdf247 100644 --- a/mu/mu-config.h +++ b/mu/mu-config.h @@ -140,12 +140,11 @@ struct _MuConfig { gchar *exec; /* command to execute on the * files for the matched * messages */ - gboolean skip_dups; /* if there are multiple - * messages with the same - * msgid, show only the first - * one */ - gboolean include_related; /* included related messages - * in results */ + gboolean include_dups; /* if there are multiple messages with + * the same msgid, show all of them, + * not just the first */ + gboolean skip_related; /* do not include related messages in + * results */ /* for find and cind */ time_t after; /* only show messages or * addresses last seen after diff --git a/mu/tests/test-mu-cmd.c b/mu/tests/test-mu-cmd.c index ffd0336b..870236d0 100644 --- a/mu/tests/test-mu-cmd.c +++ b/mu/tests/test-mu-cmd.c @@ -88,7 +88,7 @@ search (const char* query, unsigned expected) { gchar *cmdline, *output, *erroutput; - cmdline = g_strdup_printf ("%s find --muhome=%s %s", + cmdline = g_strdup_printf ("%s find --muhome=%s %s --skip-related --include-dups", MU_PROGRAM, DBPATH, query); if (g_test_verbose())