--- /dev/null
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 9EA0A431E64\r
+ for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 23:48:00 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id VrN1XO1aeTpg for <notmuch@notmuchmail.org>;\r
+ Sun, 29 Jan 2012 23:48:00 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+ [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id D0B2A431FBC\r
+ for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 23:47:59 -0800 (PST)\r
+Received: by wibhi8 with SMTP id hi8so3339593wib.26\r
+ for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 23:47:58 -0800 (PST)\r
+Received: by 10.180.106.202 with SMTP id gw10mr33282628wib.3.1327909678683;\r
+ Sun, 29 Jan 2012 23:47:58 -0800 (PST)\r
+Received: from localhost ([109.131.39.11])\r
+ by mx.google.com with ESMTPS id t6sm28281386wid.1.2012.01.29.23.47.57\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Sun, 29 Jan 2012 23:47:58 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+Subject: [PATCH v4] test: emacs: add test for `notmuch-search-operate-all'\r
+Date: Mon, 30 Jan 2012 08:45:50 +0100\r
+Message-Id: <1327909550-6788-1-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <1327599289-16865-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1327599289-16865-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 30 Jan 2012 07:48:00 -0000\r
+\r
+`notmuch-search-operate-all' (bound to "*") adds and removes tags\r
+to/from all messages which match the query used to populate the\r
+current search buffer.\r
+\r
+---\r
+\r
+Rebased to current master.\r
+\r
+Previous versions (chronologically):\r
+- id:"1309450108-2793-1-git-send-email-pieter@praet.org"\r
+- id:"1309762318-4530-5-git-send-email-pieter@praet.org"\r
+- id:"1310313335-4159-5-git-send-email-pieter@praet.org"\r
+\r
+\r
+ test/emacs | 19 +++++++++++++++++++\r
+ 1 files changed, 19 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 8ca4c8a..e94ad94 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -124,6 +124,25 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\")\r
+ output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)"\r
+ \r
++test_begin_subtest "Add/remove tags to/from all matching messages."\r
++test_emacs '(notmuch-search "tag:inbox AND tags")\r
++ (notmuch-test-wait)\r
++ (notmuch-search-operate-all "+matching" "-inbox")\r
++ (notmuch-search "tag:matching AND NOT tag:inbox")\r
++ (notmuch-test-wait)\r
++ (test-output)'\r
++cat <<EOF >EXPECTED\r
++ 2009-11-18 [3/3] Adrian Perez de Castro, Keith Packard, Carl Worth [notmuch] Introducing myself (matching signed unread)\r
++ 2009-11-18 [1/3] Carl Worth, Israel Herraiz, Keith Packard [notmuch] New to the list (inbox matching unread)\r
++ 2009-11-18 [2/2] Keith Packard, Carl Worth [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (matching unread)\r
++ 2009-11-18 [1/2] Keith Packard, Alexander Botero-Lowry [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox matching unread)\r
++ 2009-11-18 [1/1] Jan Janak [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (matching unread)\r
++ 2009-11-18 [1/1] Stewart Smith [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (matching unread)\r
++ 2009-11-17 [1/2] Ingmar Vanhassel, Carl Worth [notmuch] [PATCH] Typsos (inbox matching unread)\r
++End of search results.\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ test_begin_subtest "Message with .. in Message-Id:"\r
+ add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"'\r
+ test_emacs '(notmuch-search "id:\"123..456@example\"")\r
+-- \r
+1.7.8.1\r
+\r