Merge branch 'master' into find-exec
This commit is contained in:
@ -25,10 +25,9 @@ any).
|
|||||||
instead of displaying the full message, output a summary based upon the first
|
instead of displaying the full message, output a summary based upon the first
|
||||||
lines of the message.
|
lines of the message.
|
||||||
|
|
||||||
\fB\-\-separate\fR
|
\fB\-\-terminator\fR
|
||||||
add an ascii \\014 (0x0c, or \fIform-feed\fR) between messages when displaying
|
terminate messaages with a \\f (\fIform-feed\fR) characters when displaying
|
||||||
multiple messages.
|
them. This is useful when you want to further process them.
|
||||||
|
|
||||||
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
#include "mu-contacts.h"
|
#include "mu-contacts.h"
|
||||||
#include "mu-runtime.h"
|
#include "mu-runtime.h"
|
||||||
|
|
||||||
#define VIEW_SEPARATOR '\f' /* form-feed */
|
#define VIEW_TERMINATOR '\f' /* form-feed */
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -196,8 +196,8 @@ mu_cmd_view (MuConfig *opts)
|
|||||||
if (rv != MU_EXITCODE_OK)
|
if (rv != MU_EXITCODE_OK)
|
||||||
break;
|
break;
|
||||||
/* add a separator between two messages? */
|
/* add a separator between two messages? */
|
||||||
if (opts->params[i+1] && opts->separate)
|
if (opts->terminator)
|
||||||
g_print ("%c", VIEW_SEPARATOR);
|
g_print ("%c", VIEW_TERMINATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
|||||||
@ -245,8 +245,8 @@ config_options_group_view (MuConfig *opts)
|
|||||||
GOptionEntry entries[] = {
|
GOptionEntry entries[] = {
|
||||||
{"summary", 0, 0, G_OPTION_ARG_NONE, &opts->summary,
|
{"summary", 0, 0, G_OPTION_ARG_NONE, &opts->summary,
|
||||||
"only show a short summary of the message (false)", NULL},
|
"only show a short summary of the message (false)", NULL},
|
||||||
{"separate", 0, 0, G_OPTION_ARG_NONE, &opts->separate,
|
{"terminate", 0, 0, G_OPTION_ARG_NONE, &opts->terminator,
|
||||||
"separate messages with ascii-0x07 (form-feed)", NULL},
|
"terminate messages with ascii-0x07 (\\f, form-feed)", NULL},
|
||||||
{NULL, 0, 0, 0, NULL, NULL, NULL}
|
{NULL, 0, 0, 0, NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -108,9 +108,9 @@ struct _MuConfig {
|
|||||||
* messages */
|
* messages */
|
||||||
|
|
||||||
/* options for view */
|
/* options for view */
|
||||||
gboolean separate; /* add separator between
|
gboolean terminator; /* add separator \f between
|
||||||
* multiple messages in mu
|
* multiple messages in mu
|
||||||
* view */
|
* view */
|
||||||
|
|
||||||
/* output to a maildir with symlinks */
|
/* output to a maildir with symlinks */
|
||||||
char *linksdir; /* maildir to output symlinks */
|
char *linksdir; /* maildir to output symlinks */
|
||||||
|
|||||||
@ -212,7 +212,7 @@ static const MuMsgField FIELD_DATA[] = {
|
|||||||
MU_MSG_FIELD_TYPE_STRING_LIST,
|
MU_MSG_FIELD_TYPE_STRING_LIST,
|
||||||
"tag", 'x', 'X',
|
"tag", 'x', 'X',
|
||||||
FLAG_GMIME | FLAG_XAPIAN_TERM | FLAG_XAPIAN_PREFIX_ONLY |
|
FLAG_GMIME | FLAG_XAPIAN_TERM | FLAG_XAPIAN_PREFIX_ONLY |
|
||||||
FLAG_NORMALIZE
|
FLAG_NORMALIZE | FLAG_XAPIAN_ESCAPE
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -408,6 +408,9 @@ add_terms_values_string_list (Xapian::Document& doc, MuMsg *msg,
|
|||||||
if (mu_msg_field_normalize (mfid))
|
if (mu_msg_field_normalize (mfid))
|
||||||
mu_str_normalize_in_place (val, TRUE);
|
mu_str_normalize_in_place (val, TRUE);
|
||||||
|
|
||||||
|
if (mu_msg_field_xapian_escape (mfid))
|
||||||
|
mu_str_ascii_xapian_escape_in_place (val);
|
||||||
|
|
||||||
doc.add_term (prefix(mfid) +
|
doc.add_term (prefix(mfid) +
|
||||||
std::string(val, 0, MU_STORE_MAX_TERM_LENGTH));
|
std::string(val, 0, MU_STORE_MAX_TERM_LENGTH));
|
||||||
|
|
||||||
|
|||||||
@ -115,7 +115,7 @@ test_mu_index (void)
|
|||||||
store = mu_store_new (xpath, NULL, NULL);
|
store = mu_store_new (xpath, NULL, NULL);
|
||||||
g_assert (store);
|
g_assert (store);
|
||||||
|
|
||||||
g_assert_cmpuint (mu_store_count (store), ==, 8);
|
g_assert_cmpuint (mu_store_count (store), ==, 9);
|
||||||
mu_store_destroy (store);
|
mu_store_destroy (store);
|
||||||
|
|
||||||
g_free (muhome);
|
g_free (muhome);
|
||||||
@ -498,7 +498,7 @@ test_mu_view_multi_separate (void)
|
|||||||
tmpdir = test_mu_common_get_random_tmpdir();
|
tmpdir = test_mu_common_get_random_tmpdir();
|
||||||
g_assert (g_mkdir_with_parents (tmpdir, 0700) == 0);
|
g_assert (g_mkdir_with_parents (tmpdir, 0700) == 0);
|
||||||
|
|
||||||
cmdline = g_strdup_printf ("%s view --separate --muhome=%s "
|
cmdline = g_strdup_printf ("%s view --terminate --muhome=%s "
|
||||||
"%s%cbar%ccur%cmail5 "
|
"%s%cbar%ccur%cmail5 "
|
||||||
"%s%cbar%ccur%cmail5",
|
"%s%cbar%ccur%cmail5",
|
||||||
MU_PROGRAM,
|
MU_PROGRAM,
|
||||||
@ -517,8 +517,7 @@ test_mu_view_multi_separate (void)
|
|||||||
|
|
||||||
len = strlen(output);
|
len = strlen(output);
|
||||||
/* g_print ("\n[%s](%u)\n", output, len); */
|
/* g_print ("\n[%s](%u)\n", output, len); */
|
||||||
g_assert_cmpuint (len,==,165);
|
g_assert_cmpuint (len,==,166);
|
||||||
|
|
||||||
|
|
||||||
g_free (output);
|
g_free (output);
|
||||||
g_free (cmdline);
|
g_free (cmdline);
|
||||||
|
|||||||
@ -87,7 +87,6 @@ run_and_count_matches (const char *xpath, const char *query)
|
|||||||
MuQuery *mquery;
|
MuQuery *mquery;
|
||||||
MuMsgIter *iter;
|
MuMsgIter *iter;
|
||||||
guint count1, count2;
|
guint count1, count2;
|
||||||
GHashTable *hash;
|
|
||||||
|
|
||||||
mquery = mu_query_new (xpath, NULL);
|
mquery = mu_query_new (xpath, NULL);
|
||||||
g_assert (query);
|
g_assert (query);
|
||||||
@ -107,9 +106,6 @@ run_and_count_matches (const char *xpath, const char *query)
|
|||||||
mu_query_destroy (mquery);
|
mu_query_destroy (mquery);
|
||||||
g_assert (iter);
|
g_assert (iter);
|
||||||
|
|
||||||
hash = g_hash_table_new_full (g_str_hash, g_str_equal,
|
|
||||||
(GDestroyNotify)g_free, NULL);
|
|
||||||
|
|
||||||
assert_no_dups (iter);
|
assert_no_dups (iter);
|
||||||
|
|
||||||
/* run query twice, to test mu_msg_iter_reset */
|
/* run query twice, to test mu_msg_iter_reset */
|
||||||
@ -450,6 +446,36 @@ test_mu_query_tags (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_mu_query_tags_02 (void)
|
||||||
|
{
|
||||||
|
gchar *xpath;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
QResults queries[] = {
|
||||||
|
{ "x:paradise", 1},
|
||||||
|
{ "tag:@NextActions", 1},
|
||||||
|
{ "x:queensrÿche", 1},
|
||||||
|
{ "tag:lost OR tag:operation:mindcrime", 2},
|
||||||
|
};
|
||||||
|
|
||||||
|
xpath = fill_database (MU_TESTMAILDIR2);
|
||||||
|
g_assert (xpath != NULL);
|
||||||
|
|
||||||
|
/* g_print ("(%s)\n", xpath); */
|
||||||
|
|
||||||
|
for (i = 0; i != G_N_ELEMENTS(queries); ++i) {
|
||||||
|
/* g_print ("%s\n", queries[i].query); */
|
||||||
|
g_assert_cmpuint (run_and_count_matches (xpath, queries[i].query),
|
||||||
|
==, queries[i].count);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_free (xpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -474,6 +500,8 @@ main (int argc, char *argv[])
|
|||||||
test_mu_query_attach);
|
test_mu_query_attach);
|
||||||
g_test_add_func ("/mu-query/test-mu-query-tags",
|
g_test_add_func ("/mu-query/test-mu-query-tags",
|
||||||
test_mu_query_tags);
|
test_mu_query_tags);
|
||||||
|
g_test_add_func ("/mu-query/test-mu-query-tags_02",
|
||||||
|
test_mu_query_tags_02);
|
||||||
|
|
||||||
g_log_set_handler (NULL,
|
g_log_set_handler (NULL,
|
||||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
|
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
|
||||||
|
|||||||
18
src/tests/testdir2/bar/cur/mail6
Normal file
18
src/tests/testdir2/bar/cur/mail6
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
Date: Thu, 31 Jul 2008 14:57:25 -0400
|
||||||
|
From: "Geoff Tate" <jeff@example.com>
|
||||||
|
Subject: eyes of a stranger
|
||||||
|
To: "Enrico Fermi" <enrico@example.com>
|
||||||
|
Message-id: <3BE9E6535E302944823E7A1A20D852173@msg.id>
|
||||||
|
MIME-version: 1.0
|
||||||
|
X-label: @NextActions, operation:mindcrime, Queensrÿche
|
||||||
|
Content-type: text/plain; charset=us-ascii
|
||||||
|
Content-transfer-encoding: 7BIT
|
||||||
|
Precedence: high
|
||||||
|
|
||||||
|
And I raise my head and stare
|
||||||
|
Into the eyes of a stranger
|
||||||
|
I've always known that the mirror never lies
|
||||||
|
People always turn away
|
||||||
|
From the eyes of a stranger
|
||||||
|
Afraid to know what
|
||||||
|
Lies behind the stare
|
||||||
Reference in New Issue
Block a user