mirror of https://github.com/djcb/mu.git
* add 'flag:unread' as a synonym for 'flag:new OR NOT flag:seen'
- update documentation - update test cases - some cleanups in the C++-code - bump the database version, to trigger the --rebuild warning
This commit is contained in:
parent
9a4ba103d2
commit
b27a9f47c4
5
NEWS
5
NEWS
|
@ -1,5 +1,10 @@
|
||||||
* NEWS (user visible changes)
|
* NEWS (user visible changes)
|
||||||
|
|
||||||
|
** Release 0.9.4
|
||||||
|
|
||||||
|
- add the 'cfind' command, to search/export contact information
|
||||||
|
- add 'flag:unread' as a synonym for 'flag:new OR NOT flag:unseen'
|
||||||
|
|
||||||
** Release 0.9.3 <2011-02-13 Sun>
|
** Release 0.9.3 <2011-02-13 Sun>
|
||||||
|
|
||||||
- don't warn about missing files with --quiet
|
- don't warn about missing files with --quiet
|
||||||
|
|
|
@ -142,7 +142,7 @@ AC_SUBST(XAPIAN_LIBS)
|
||||||
# note that MU_XAPIAN_DB_VERSION does not necessarily follow MU
|
# note that MU_XAPIAN_DB_VERSION does not necessarily follow MU
|
||||||
# versioning, as we hopefully don't have updates for each version;
|
# versioning, as we hopefully don't have updates for each version;
|
||||||
# also, this has nothing to do with Xapian's software version
|
# also, this has nothing to do with Xapian's software version
|
||||||
AC_DEFINE(MU_XAPIAN_DB_VERSION,["9.2"], ['Schema' version of the database])
|
AC_DEFINE(MU_XAPIAN_DB_VERSION,["9.4"], ['Schema' version of the database])
|
||||||
|
|
||||||
AC_ARG_WITH([gui],
|
AC_ARG_WITH([gui],
|
||||||
[AS_HELP_STRING([--with-gui=gtk2|gtk3|none])],
|
[AS_HELP_STRING([--with-gui=gtk2|gtk3|none])],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH MU-EASY 1 "November 2010" "User Manuals"
|
.TH MU-EASY 1 "March 2010" "User Manuals"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
||||||
|
@ -42,7 +42,8 @@ When \fBmu\fR sees such a file, it will excluded this directory and its
|
||||||
sub-directories.
|
sub-directories.
|
||||||
|
|
||||||
.SH SEARCHING YOUR E-MAIL
|
.SH SEARCHING YOUR E-MAIL
|
||||||
After you have indexed your mail, you can search it. Normally, the search
|
|
||||||
|
After you have indexed your mail,you can search it. Normally, the search
|
||||||
results are to standard output, but the output can also be in the form of
|
results are to standard output, but the output can also be in the form of
|
||||||
Maildir with symbolic links to the found messages. This enables integration
|
Maildir with symbolic links to the found messages. This enables integration
|
||||||
with e-mail clients; see the \fBmu-find\fR man page for details, the syntax of
|
with e-mail clients; see the \fBmu-find\fR man page for details, the syntax of
|
||||||
|
@ -138,11 +139,11 @@ Get all messages from Jim without an attachment:
|
||||||
|
|
||||||
Get all unread messages where the subject mentions Ångström:
|
Get all unread messages where the subject mentions Ångström:
|
||||||
.nf
|
.nf
|
||||||
\fB$ mu find flag:new subject:Ångström\fR
|
\fB$ mu find flag:unread subject:Ångström\fR
|
||||||
.fi
|
.fi
|
||||||
which is equivalent to:
|
which is equivalent to:
|
||||||
.nf
|
.nf
|
||||||
\fB$ mu find flag:new subject:angstrom\fR
|
\fB$ mu find flag:unread subject:angstrom\fR
|
||||||
.fi
|
.fi
|
||||||
because does mu is case-insensitive and accent-insensitive.
|
because does mu is case-insensitive and accent-insensitive.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH MU FIND 1 "January 2011" "User Manuals"
|
.TH MU FIND 1 "March 2011" "User Manuals"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ listed in the following table:
|
||||||
p,passed Passed ('Handled')
|
p,passed Passed ('Handled')
|
||||||
r,replied Replied
|
r,replied Replied
|
||||||
s,seen Seen
|
s,seen Seen
|
||||||
|
u,unread Unread (shorthand for 'new or not seen')
|
||||||
t,thrashed Marked for deletion
|
t,thrashed Marked for deletion
|
||||||
a,attach Has attachment
|
a,attach Has attachment
|
||||||
z,signed Signed message
|
z,signed Signed message
|
||||||
|
@ -400,13 +401,14 @@ Find all messages in the 'Archive' folder from Fred:
|
||||||
$ mu find from:fred maildir:/Archive
|
$ mu find from:fred maildir:/Archive
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
Find all messages with attachments:
|
Find all unread messages with attachments:
|
||||||
|
|
||||||
.nf
|
.nf
|
||||||
$ mu find flag:attach
|
$ mu find flag:unread flag:attach
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.SS Integrating mu find with mail clients
|
.SS Integrating mu find with mail clients
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
|
|
@ -99,7 +99,8 @@ mu_msg_file_get_flags_from_path (const char *path)
|
||||||
|
|
||||||
mtype = check_msg_type (path, &info);
|
mtype = check_msg_type (path, &info);
|
||||||
if (mtype == MSG_TYPE_NEW) { /* we ignore any new-msg flags */
|
if (mtype == MSG_TYPE_NEW) { /* we ignore any new-msg flags */
|
||||||
flags = MU_MSG_FLAG_NEW;
|
/* note NEW implies UNREAD */
|
||||||
|
flags = MU_MSG_FLAG_NEW | MU_MSG_FLAG_UNREAD;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +121,10 @@ mu_msg_file_get_flags_from_path (const char *path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* the UNREAD pseudo flag => NEW OR NOT SEEN */
|
||||||
|
if (!(flags & MU_MSG_FLAG_SEEN))
|
||||||
|
flags |= MU_MSG_FLAG_UNREAD;
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
g_free(info);
|
g_free(info);
|
||||||
return flags;
|
return flags;
|
||||||
|
@ -147,7 +152,7 @@ get_flags_str_s (MuMsgFlags flags)
|
||||||
flagstr[i++] = 'S';
|
flagstr[i++] = 'S';
|
||||||
if (flags & MU_MSG_FLAG_TRASHED)
|
if (flags & MU_MSG_FLAG_TRASHED)
|
||||||
flagstr[i++] = 'T';
|
flagstr[i++] = 'T';
|
||||||
|
|
||||||
flagstr[i] = '\0';
|
flagstr[i] = '\0';
|
||||||
|
|
||||||
return flagstr;
|
return flagstr;
|
||||||
|
|
|
@ -37,6 +37,7 @@ static const MuMsgFlags ALL_FLAGS[] = {
|
||||||
/* r */ MU_MSG_FLAG_REPLIED,
|
/* r */ MU_MSG_FLAG_REPLIED,
|
||||||
/* s */ MU_MSG_FLAG_SEEN,
|
/* s */ MU_MSG_FLAG_SEEN,
|
||||||
/* t */ MU_MSG_FLAG_TRASHED,
|
/* t */ MU_MSG_FLAG_TRASHED,
|
||||||
|
/* u */ MU_MSG_FLAG_UNREAD,
|
||||||
/* x */ MU_MSG_FLAG_ENCRYPTED,
|
/* x */ MU_MSG_FLAG_ENCRYPTED,
|
||||||
/* z */ MU_MSG_FLAG_SIGNED
|
/* z */ MU_MSG_FLAG_SIGNED
|
||||||
};
|
};
|
||||||
|
@ -53,7 +54,10 @@ mu_msg_flag_from_char (char k)
|
||||||
case 't': return MU_MSG_FLAG_TRASHED;
|
case 't': return MU_MSG_FLAG_TRASHED;
|
||||||
case 'd': return MU_MSG_FLAG_DRAFT;
|
case 'd': return MU_MSG_FLAG_DRAFT;
|
||||||
case 'f': return MU_MSG_FLAG_FLAGGED;
|
case 'f': return MU_MSG_FLAG_FLAGGED;
|
||||||
|
|
||||||
|
/* NEW OR NOT SEEN */
|
||||||
|
case 'u': return MU_MSG_FLAG_UNREAD;
|
||||||
|
|
||||||
case 'z': return MU_MSG_FLAG_SIGNED;
|
case 'z': return MU_MSG_FLAG_SIGNED;
|
||||||
case 'x': return MU_MSG_FLAG_ENCRYPTED;
|
case 'x': return MU_MSG_FLAG_ENCRYPTED;
|
||||||
case 'a': return MU_MSG_FLAG_HAS_ATTACH;
|
case 'a': return MU_MSG_FLAG_HAS_ATTACH;
|
||||||
|
@ -75,6 +79,9 @@ mu_msg_flag_name (MuMsgFlags flag)
|
||||||
case MU_MSG_FLAG_TRASHED: return "trashed";
|
case MU_MSG_FLAG_TRASHED: return "trashed";
|
||||||
case MU_MSG_FLAG_DRAFT: return "draft";
|
case MU_MSG_FLAG_DRAFT: return "draft";
|
||||||
case MU_MSG_FLAG_FLAGGED: return "flagged";
|
case MU_MSG_FLAG_FLAGGED: return "flagged";
|
||||||
|
|
||||||
|
/* ie., NEW or NOT SEEN */
|
||||||
|
case MU_MSG_FLAG_UNREAD: return "unread";
|
||||||
|
|
||||||
case MU_MSG_FLAG_SIGNED: return "signed";
|
case MU_MSG_FLAG_SIGNED: return "signed";
|
||||||
case MU_MSG_FLAG_ENCRYPTED: return "encrypted";
|
case MU_MSG_FLAG_ENCRYPTED: return "encrypted";
|
||||||
|
@ -96,6 +103,9 @@ mu_msg_flag_char (MuMsgFlags flag)
|
||||||
case MU_MSG_FLAG_TRASHED: return 't';
|
case MU_MSG_FLAG_TRASHED: return 't';
|
||||||
case MU_MSG_FLAG_DRAFT: return 'd';
|
case MU_MSG_FLAG_DRAFT: return 'd';
|
||||||
case MU_MSG_FLAG_FLAGGED: return 'f';
|
case MU_MSG_FLAG_FLAGGED: return 'f';
|
||||||
|
|
||||||
|
/* NEW OR NOT SEEN */
|
||||||
|
case MU_MSG_FLAG_UNREAD: return 'u';
|
||||||
|
|
||||||
case MU_MSG_FLAG_SIGNED: return 'z';
|
case MU_MSG_FLAG_SIGNED: return 'z';
|
||||||
case MU_MSG_FLAG_ENCRYPTED: return 'x';
|
case MU_MSG_FLAG_ENCRYPTED: return 'x';
|
||||||
|
|
|
@ -56,14 +56,19 @@ enum _MuMsgFlags {
|
||||||
/* "F"->flagged message */
|
/* "F"->flagged message */
|
||||||
MU_MSG_FLAG_FLAGGED = 1 << 6,
|
MU_MSG_FLAG_FLAGGED = 1 << 6,
|
||||||
|
|
||||||
|
/* "U"->unread message; it's a pseudo/convenience flag that
|
||||||
|
* means (NEW or not SEEN) */
|
||||||
|
MU_MSG_FLAG_UNREAD = 1 << 7,
|
||||||
|
|
||||||
|
|
||||||
/* these we get from the contents */
|
/* these we get from the contents */
|
||||||
|
|
||||||
/* "Z"->signed message */
|
/* "Z"->signed message */
|
||||||
MU_MSG_FLAG_SIGNED = 1 << 7,
|
MU_MSG_FLAG_SIGNED = 1 << 8,
|
||||||
/* "X"->encrypted message */
|
/* "X"->encrypted message */
|
||||||
MU_MSG_FLAG_ENCRYPTED = 1 << 8,
|
MU_MSG_FLAG_ENCRYPTED = 1 << 9,
|
||||||
/* "A"->message has attachment */
|
/* "A"->message has attachment */
|
||||||
MU_MSG_FLAG_HAS_ATTACH = 1 << 9
|
MU_MSG_FLAG_HAS_ATTACH = 1 << 10
|
||||||
};
|
};
|
||||||
typedef enum _MuMsgFlags MuMsgFlags;
|
typedef enum _MuMsgFlags MuMsgFlags;
|
||||||
|
|
||||||
|
|
|
@ -309,30 +309,24 @@ add_terms_values_date (Xapian::Document& doc, MuMsg *msg,
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_terms_values_number (Xapian::Document& doc, MuMsg *msg,
|
add_terms_values_number (Xapian::Document& doc, MuMsg *msg, MuMsgFieldId mfid)
|
||||||
MuMsgFieldId mfid)
|
|
||||||
{
|
{
|
||||||
const std::string pfx (1, mu_msg_field_xapian_prefix(mfid));
|
const std::string pfx (1, mu_msg_field_xapian_prefix(mfid));
|
||||||
gint64 num = mu_msg_get_field_numeric (msg, mfid);
|
gint64 num = mu_msg_get_field_numeric (msg, mfid);
|
||||||
|
|
||||||
const std::string numstr (Xapian::sortable_serialise((double)num));
|
const std::string numstr (Xapian::sortable_serialise((double)num));
|
||||||
|
|
||||||
doc.add_value ((Xapian::valueno)mfid, numstr);
|
doc.add_value ((Xapian::valueno)mfid, numstr);
|
||||||
|
|
||||||
if (mfid == MU_MSG_FIELD_ID_FLAGS) {
|
if (mfid == MU_MSG_FIELD_ID_FLAGS) {
|
||||||
const char* flags, *cur;
|
for (const char *cur = mu_msg_flags_str_s ((MuMsgFlags)num);
|
||||||
cur = flags = mu_msg_flags_str_s ((MuMsgFlags)num);
|
cur && *cur; ++cur)
|
||||||
while (cur && *cur) {
|
doc.add_term (pfx + (char)tolower (*cur));
|
||||||
char kar = tolower (*cur);
|
|
||||||
doc.add_term (pfx + kar);
|
|
||||||
++cur;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (mfid == MU_MSG_FIELD_ID_PRIO) {
|
} else if (mfid == MU_MSG_FIELD_ID_PRIO) {
|
||||||
doc.add_term (pfx + std::string(1,
|
doc.add_term (pfx + std::string(1,
|
||||||
mu_msg_prio_char((MuMsgPrio)num)));
|
mu_msg_prio_char((MuMsgPrio)num)));
|
||||||
|
} //else
|
||||||
} else
|
// doc.add_term (pfx + numstr);
|
||||||
doc.add_term (pfx + numstr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -40,14 +40,15 @@ static void test_mu_msg_file_get_flags_from_path(void)
|
||||||
MuMsgFlags flags;
|
MuMsgFlags flags;
|
||||||
} paths[] = {
|
} paths[] = {
|
||||||
{
|
{
|
||||||
"/home/foo/Maildir/test/cur/123456:2,FR",
|
"/home/foo/Maildir/test/cur/123456:2,FSR",
|
||||||
MU_MSG_FLAG_REPLIED | MU_MSG_FLAG_FLAGGED}, {
|
MU_MSG_FLAG_REPLIED | MU_MSG_FLAG_SEEN | MU_MSG_FLAG_FLAGGED}, {
|
||||||
"/home/foo/Maildir/test/new/123456", MU_MSG_FLAG_NEW}, {
|
"/home/foo/Maildir/test/new/123456",
|
||||||
|
MU_MSG_FLAG_NEW | MU_MSG_FLAG_UNREAD}, {
|
||||||
"/home/foo/Maildir/test/new/123456:2,FR",
|
"/home/foo/Maildir/test/new/123456:2,FR",
|
||||||
MU_MSG_FLAG_NEW}, {
|
MU_MSG_FLAG_NEW | MU_MSG_FLAG_UNREAD}, {
|
||||||
"/home/foo/Maildir/test/cur/123456:2,DTP",
|
"/home/foo/Maildir/test/cur/123456:2,DTP",
|
||||||
MU_MSG_FLAG_DRAFT | MU_MSG_FLAG_TRASHED |
|
MU_MSG_FLAG_DRAFT | MU_MSG_FLAG_TRASHED |
|
||||||
MU_MSG_FLAG_PASSED}, {
|
MU_MSG_FLAG_PASSED | MU_MSG_FLAG_UNREAD }, {
|
||||||
"/home/foo/Maildir/test/cur/123456:2,S",
|
"/home/foo/Maildir/test/cur/123456:2,S",
|
||||||
MU_MSG_FLAG_SEEN}
|
MU_MSG_FLAG_SEEN}
|
||||||
};
|
};
|
||||||
|
|
|
@ -182,7 +182,7 @@ test_mu_msg_03 (void)
|
||||||
"\nLet's write some fünkÿ text\nusing umlauts.\n\nFoo.\n");
|
"\nLet's write some fünkÿ text\nusing umlauts.\n\nFoo.\n");
|
||||||
|
|
||||||
g_assert_cmpuint (mu_msg_get_flags(msg),
|
g_assert_cmpuint (mu_msg_get_flags(msg),
|
||||||
==, 0);
|
==, MU_MSG_FLAG_UNREAD);
|
||||||
|
|
||||||
|
|
||||||
mu_msg_unref (msg);
|
mu_msg_unref (msg);
|
||||||
|
|
Loading…
Reference in New Issue