about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2016-07-28 18:47:17 +0200
committerDuncaen <mail@duncano.de>2016-07-28 18:47:50 +0200
commita37c401ad1df49879a520f06322809a3f053bbf1 (patch)
tree10462c1b85c47c691b7c22085c825d7c2b2149cb
parent235abbd53f59a8da3ac3817fa53d3b49991f3cbc (diff)
downloadmblaze-a37c401ad1df49879a520f06322809a3f053bbf1.tar.gz
mblaze-a37c401ad1df49879a520f06322809a3f053bbf1.tar.xz
mblaze-a37c401ad1df49879a520f06322809a3f053bbf1.zip
mpick: add info expression for message ids without files
and mark them seen by default
-rw-r--r--man/mpick.12
-rw-r--r--mpick.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/man/mpick.1 b/man/mpick.1
index 1e62b58..ca955e4 100644
--- a/man/mpick.1
+++ b/man/mpick.1
@@ -96,7 +96,7 @@ tests are given by the following EBNF:
              | prune             -- do not match futher messages in thread
              | print             -- always true value
 
-<flagprop> ::= child | draft | flagged | new | parent | passed
+<flagprop> ::= child | draft | flagged | info | new | parent | passed
              | replied  | seen | selected | trashed
 
 <timeprop> ::= atime | ctime | mtime | date
diff --git a/mpick.c b/mpick.c
index 1dadf84..a04ddf0 100644
--- a/mpick.c
+++ b/mpick.c
@@ -87,6 +87,8 @@ enum flags {
 
 	FLAG_PARENT = 256,
 	FLAG_CHILD = 512,
+
+	FLAG_INFO = 1024,
 };
 
 struct expr {
@@ -413,6 +415,8 @@ parse_flag()
 		flag = FLAG_NEW;
 	} else if (token("cur")) {
 		flag = FLAG_CUR;
+	} else if (token("info")) {
+		flag = FLAG_INFO;
 	} else if (token("parent")) {
 		flag = FLAG_PARENT;
 		need_thr = 1;
@@ -849,6 +853,11 @@ mailfile(char *file)
 	while (m->fpath < e && (*e == ' ' || *e == '\t'))
 		*e-- = 0;
 
+	if (m->fpath[0] == '<') {
+		m->flags |= FLAG_SEEN | FLAG_INFO;
+		return m;
+	}
+
 	m->msg = blaze822(m->fpath);
 	if (!m->msg)
 		return m;