diff --git a/NEWS b/NEWS index f7baae1c..5a3eb51b 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ - add 'mu script' command to run mu script, for example to do statistics on your message corpus - allow 'contact:' as a shortcut in queries for 'from:foo OR to:foo OR + cc:foo OR bcc:foo', and 'recip:' as a shortcut for 'to:foo OR cc:foo OR bcc:foo' *** mu4e @@ -23,6 +24,11 @@ message view. Thanks to Abdó Roig-Maranges. New field ":tags". - automatically update the headers buffer when new messages are found during indexing; set `mu4e-headers-auto-update' to nil to disable this. + - update mail/index with M-x mu4e-update-mail-and-index; which everywhere in + mu4e is available with key C-S-u. Use prefix argument to run in + background. + - add function `mu4e-update-index' to only update the index + * Old news :PROPERTIES: diff --git a/lib/mu-msg-fields.h b/lib/mu-msg-fields.h index aaf538e4..7e1a60fb 100644 --- a/lib/mu-msg-fields.h +++ b/lib/mu-msg-fields.h @@ -67,6 +67,10 @@ static const MuMsgFieldId MU_MSG_FIELD_ID_NONE = (MuMsgFieldId)-1; * in mu-query.cc and mu-str.c */ #define MU_MSG_FIELD_PSEUDO_CONTACT "contact" +/* this is a shortcut for To/Cc/Bcc in queries; handled specially in + * mu-query.cc and mu-str.c */ +#define MU_MSG_FIELD_PSEUDO_RECIP "recip" + #define mu_msg_field_id_is_valid(MFID) \ ((MFID) < MU_MSG_FIELD_ID_NUM) diff --git a/lib/mu-query.cc b/lib/mu-query.cc index 36c0b624..6367eb84 100644 --- a/lib/mu-query.cc +++ b/lib/mu-query.cc @@ -187,8 +187,7 @@ private: void add_special_prefixes () { char pfx[] = { '\0', '\0' }; - /* add 'contact' as a shortcut for - * From/Cc/Bcc/To: */ + /* add 'contact' as a shortcut for From/Cc/Bcc/To: */ pfx[0] = mu_msg_field_xapian_prefix(MU_MSG_FIELD_ID_FROM); _qparser.add_prefix (MU_MSG_FIELD_PSEUDO_CONTACT, pfx); pfx[0] = mu_msg_field_xapian_prefix(MU_MSG_FIELD_ID_TO); @@ -197,6 +196,14 @@ private: _qparser.add_prefix (MU_MSG_FIELD_PSEUDO_CONTACT, pfx); pfx[0] = mu_msg_field_xapian_prefix(MU_MSG_FIELD_ID_BCC); _qparser.add_prefix (MU_MSG_FIELD_PSEUDO_CONTACT, pfx); + + /* add 'recip' as a shortcut for Cc/Bcc/To: */ + pfx[0] = mu_msg_field_xapian_prefix(MU_MSG_FIELD_ID_TO); + _qparser.add_prefix (MU_MSG_FIELD_PSEUDO_RECIP, pfx); + pfx[0] = mu_msg_field_xapian_prefix(MU_MSG_FIELD_ID_CC); + _qparser.add_prefix (MU_MSG_FIELD_PSEUDO_RECIP, pfx); + pfx[0] = mu_msg_field_xapian_prefix(MU_MSG_FIELD_ID_BCC); + _qparser.add_prefix (MU_MSG_FIELD_PSEUDO_RECIP, pfx); } Xapian::QueryParser _qparser; diff --git a/lib/mu-str.c b/lib/mu-str.c index 23329f92..1f44dd4f 100644 --- a/lib/mu-str.c +++ b/lib/mu-str.c @@ -439,8 +439,11 @@ check_for_field (const char *str, gboolean *is_field, &pfx); /* also check special prefixes... */ if (!pfx.match) - pfx.match = g_str_has_prefix - (str, MU_MSG_FIELD_PSEUDO_CONTACT ":"); + pfx.match = + g_str_has_prefix + (str, MU_MSG_FIELD_PSEUDO_CONTACT ":") || + g_str_has_prefix + (str, MU_MSG_FIELD_PSEUDO_RECIP ":"); *is_field = pfx.match; *is_range_field = pfx.range_field; diff --git a/man/mu-find.1 b/man/mu-find.1 index 79f5dc84..7ec61e71 100644 --- a/man/mu-find.1 +++ b/man/mu-find.1 @@ -119,14 +119,14 @@ search fields and their abbreviations: tag,x Tags for the message (\fIX-Label\fR and/or \fIX-Keywords\fR) .fi -There is also the special field \fBcontact\fR, which matches all -contact-fields (\fBfrom\fR, \fBto\fR, \fBcc\fR and \fBbcc\fR). +There are also the special fields \fBcontact\fR, which matches all +contact-fields (\fBfrom\fR, \fBto\fR, \fBcc\fR and \fBbcc\fR), and +\fBrecip\fR, which matches all recipient-fields (\fBto\fR, \fBcc\fR and +\fBbcc\fR). -The meaning of most of these fields should be clear, but some require some -extra discusion. - -First, the message flags field describes certain properties of the message, as -listed in the following table: +The meaning of most of the above fields should be clear, but some require some +extra discusion. First, the message flags field describes certain properties +of the message, as listed in the following table: .nf d,draft Draft Message