From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id DD0656DE19A5 for ; Thu, 16 Feb 2017 19:08:07 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id meZhQqmHC94o for ; Thu, 16 Feb 2017 19:08:07 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id D59416DE1971 for ; Thu, 16 Feb 2017 19:08:04 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1ceYtL-00035S-Ts; Thu, 16 Feb 2017 22:07:28 -0500 Received: (nullmailer pid 32141 invoked by uid 1000); Fri, 17 Feb 2017 03:07:58 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [patch v5 5/6] lib: add mid: as a synonym for id: Date: Thu, 16 Feb 2017 23:07:53 -0400 Message-Id: <20170217030754.32069-6-david@tethera.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170217030754.32069-1-david@tethera.net> References: <20170217030754.32069-1-david@tethera.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2017 03:08:08 -0000 mid: is the url scheme suggested by URL 2392. We also plan to introduce more flexible searches for mid: than are possible with id: (in order not to break assumptions about the special behaviour of id:, e.g. identifying at most one message). --- lib/database.cc | 1 + test/T080-search.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/database.cc b/lib/database.cc index ee971f32..21c8c5f2 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -262,6 +262,7 @@ prefix_t prefix_table[] = { { "tag", "K", NOTMUCH_FIELD_EXTERNAL }, { "is", "K", NOTMUCH_FIELD_EXTERNAL }, { "id", "Q", NOTMUCH_FIELD_EXTERNAL }, + { "mid", "Q", NOTMUCH_FIELD_EXTERNAL }, { "path", "P", NOTMUCH_FIELD_EXTERNAL }, { "property", "XPROPERTY", NOTMUCH_FIELD_EXTERNAL }, /* diff --git a/test/T080-search.sh b/test/T080-search.sh index 5e8b20ce..6149da93 100755 --- a/test/T080-search.sh +++ b/test/T080-search.sh @@ -34,6 +34,11 @@ add_message '[subject]="search by id"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000" output=$(notmuch search id:${gen_msg_id} | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unread)" +test_begin_subtest "Search by mid:" +add_message '[subject]="search by mid"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(notmuch search mid:${gen_msg_id} | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by mid (inbox unread)" + test_begin_subtest "Search by tag:" add_message '[subject]="search by tag"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' notmuch tag +searchbytag id:${gen_msg_id} @@ -127,6 +132,7 @@ thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-sübjéct (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unread) +thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by mid (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox searchbytag unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (inbox unread) -- 2.11.0