mirror of https://github.com/djcb/mu.git
* mu: add 'contact:' as an alias for to:/from:/cc:/bcc:
This commit is contained in:
parent
8ad01e4aa8
commit
48467099b5
4
TODO
4
TODO
|
@ -9,7 +9,6 @@
|
|||
- put threading information in the database, and enable getting the complete
|
||||
threads when searching
|
||||
- refactor fill_database function in test cases
|
||||
- add 'contact:' as alias for to: or cc: or bcc: or from:
|
||||
|
||||
*** mu-guile
|
||||
|
||||
|
@ -52,7 +51,7 @@
|
|||
* Done (0.9.9.x)
|
||||
|
||||
- mu4e: scroll down –> go to next message
|
||||
|
||||
- mu: add contact: as a shortcut for matching from/to/cc/bcc:
|
||||
|
||||
|
||||
* Done
|
||||
|
@ -157,4 +156,3 @@
|
|||
# Local Variables:
|
||||
# mode: org
|
||||
# End:
|
||||
|
||||
|
|
|
@ -63,6 +63,10 @@ typedef guint8 MuMsgFieldId;
|
|||
static const MuMsgFieldId MU_MSG_FIELD_ID_NONE = (MuMsgFieldId)-1;
|
||||
#define MU_MSG_STRING_FIELD_ID_NUM (MU_MSG_FIELD_ID_UID + 1)
|
||||
|
||||
/* this is a shortcut for To/From/Cc/Bcc in queries; handled specially
|
||||
* in mu-query.cc and mu-str.c */
|
||||
#define MU_MSG_FIELD_PSEUDO_CONTACT "contact"
|
||||
|
||||
#define mu_msg_field_id_is_valid(MFID) \
|
||||
((MFID) < MU_MSG_FIELD_ID_NUM)
|
||||
|
||||
|
|
|
@ -166,6 +166,9 @@ public:
|
|||
|
||||
mu_msg_field_foreach ((MuMsgFieldForeachFunc)add_prefix,
|
||||
&_qparser);
|
||||
|
||||
/* add some convenient special prefixes */
|
||||
add_special_prefixes ();
|
||||
}
|
||||
|
||||
~_MuQuery () { mu_store_unref (_store); }
|
||||
|
@ -181,6 +184,21 @@ public:
|
|||
Xapian::QueryParser& query_parser () { return _qparser; }
|
||||
|
||||
private:
|
||||
void add_special_prefixes () {
|
||||
char pfx[] = { '\0', '\0' };
|
||||
|
||||
/* 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);
|
||||
_qparser.add_prefix (MU_MSG_FIELD_PSEUDO_CONTACT, pfx);
|
||||
pfx[0] = mu_msg_field_xapian_prefix(MU_MSG_FIELD_ID_CC);
|
||||
_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);
|
||||
}
|
||||
|
||||
Xapian::QueryParser _qparser;
|
||||
MuDateRangeProcessor _date_range_processor;
|
||||
MuSizeRangeProcessor _size_range_processor;
|
||||
|
|
|
@ -437,6 +437,10 @@ check_for_field (const char *str, gboolean *is_field,
|
|||
|
||||
mu_msg_field_foreach ((MuMsgFieldForeachFunc)each_check_prefix,
|
||||
&pfx);
|
||||
/* also check special prefixes... */
|
||||
if (!pfx.match)
|
||||
pfx.match = g_str_has_prefix
|
||||
(str, MU_MSG_FIELD_PSEUDO_CONTACT ":");
|
||||
|
||||
*is_field = pfx.match;
|
||||
*is_range_field = pfx.range_field;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.TH MU-EASY 1 "July 2012" "User Manuals"
|
||||
.TH MU-EASY 1 "October 2012" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
|
||||
|
@ -144,6 +144,13 @@ Get all messages from Jim without an attachment:
|
|||
\fB$ mu find from:jim AND NOT flag:attach\fR
|
||||
.fi
|
||||
|
||||
Get all messages where Jack is in one of the contact fields:
|
||||
.nf
|
||||
\fB$ mu find contact:jack\fR
|
||||
.fi
|
||||
This uses the special contact: pseudo-field which matches (\fBfrom\fR,
|
||||
\fBto\fR, \fBcc\fR and \fBbcc\fR).
|
||||
|
||||
Get all messages in the Sent Items folder about yoghurt:
|
||||
.nf
|
||||
\fB$mu find maildir:'/Sent Items' yoghurt\fR
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.TH MU FIND 1 "August 2012" "User Manuals"
|
||||
.TH MU FIND 1 "October 2012" "User Manuals"
|
||||
|
||||
.SH NAME
|
||||
|
||||
|
@ -105,8 +105,8 @@ search fields and their abbreviations:
|
|||
cc,c Cc (carbon-copy) recipient(s)
|
||||
bcc,h Bcc (blind-carbon-copy) recipient(s)
|
||||
from,f Message sender
|
||||
subject,s Message subject
|
||||
to,t To: recipient(s)
|
||||
subject,s Message subject
|
||||
maildir,m Maildir
|
||||
msgid,i Message-ID
|
||||
prio,p Message priority ('low', 'normal' or 'high')
|
||||
|
@ -119,9 +119,10 @@ search fields and their abbreviations:
|
|||
tag,x Tags for the message (\fIX-Label\fR and/or \fIX-Keywords\fR)
|
||||
.fi
|
||||
|
||||
For clarity, this man-page uses the longer versions.
|
||||
There is also the special field \fBcontact\fR, which matches all
|
||||
contact-fields (\fBfrom\fR, \fBto\fR, \fBcc\fR and \fBbcc\fR).
|
||||
|
||||
`The meaning of most of these fields should be clear, but some require some
|
||||
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
|
||||
|
|
|
@ -1485,6 +1485,10 @@ flag:signed prio:high
|
|||
# get all messages from Jim without an attachment:
|
||||
from:jim AND NOT flag:attach
|
||||
|
||||
# get all message with Alice in one of the contacts fields (to, from, cc,
|
||||
# bcc):
|
||||
contact:alice
|
||||
|
||||
# get all unread messages where the subject mentions Angstrom:
|
||||
# (search is case-insensitive and accent-insensitive)
|
||||
subject:angstrom flag:unread
|
||||
|
|
Loading…
Reference in New Issue