--- /dev/null
+Return-Path: <mpn@google.com>\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 AF07F431FB6\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Sep 2012 04:40:05 -0700 (PDT)\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=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7]\r
+ 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 a6eOWYq+onqP for <notmuch@notmuchmail.org>;\r
+ Mon, 3 Sep 2012 04:40:05 -0700 (PDT)\r
+Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com\r
+ [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id A4252431FAF\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Sep 2012 04:40:04 -0700 (PDT)\r
+Received: by eaan10 with SMTP id n10so1867278eaa.26\r
+ for <notmuch@notmuchmail.org>; Mon, 03 Sep 2012 04:40:03 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\r
+ s=20120113; h=sender:from:to:cc:subject:in-reply-to:organization:references\r
+ :user-agent:x-face:face:x-pgp:x-pgp-fp:date:message-id:mime-version\r
+ :content-type; bh=3wE4iNbSgvt4lTGWlkXf1q2EtUlP+3SzivIJ0FAdM6c=;\r
+ b=Hn50WNDzSJjYPoZt7XLIEPPhn7uabg6HuZiFwTKyda37AI8X59EgHNqsW2kaZ9h5DC\r
+ Myk4bjd5NrLJqtHkEEB8Ou2a41Qi3i5dgyw3RBMol9hI63k86yoJ0HHB8mPiBS+KJNCZ\r
+ +DYJn4bAC1Uxbn/CEw3fL0ravhSot9jLa+rS8ZohehVwq/8IY9B5FYlEdxnjhAeTfOuR\r
+ wy7oQRwgeq86MAzEgAeoPbXeGf7bxRCL3/OEgn+JKD86QRzTdhDjrV5wCIIxv288qa8b\r
+ YmLw69mEdFSwWcVtCwL21zslLb5n3WyiZVK7AMKctRuDFxwov+4ZIBaaO7F2OvfxozdY 3lvQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=sender:from:to:cc:subject:in-reply-to:organization:references\r
+ :user-agent:x-face:face:x-pgp:x-pgp-fp:date:message-id:mime-version\r
+ :content-type:x-gm-message-state;\r
+ bh=3wE4iNbSgvt4lTGWlkXf1q2EtUlP+3SzivIJ0FAdM6c=;\r
+ b=kOM60nQjwzvOYza7vbEPjL9WZA/0cjHHHl3AMYrJUuxTueH45wVpEV2fhboNiQaCHs\r
+ 3JtxuRfu9IGFd6kiAmER8nEiO14MuUFOzas69TErQk88gcpbXMVvnd/W79IwhddcoAZ6\r
+ ELyBvO6cgEBS48hzd1iYj7ire+9RTAmTPAvUT7Qf1Gb+3Y4Mjp/60NHWDpBwGhCZDOaV\r
+ w0G7jCI38qrHx8dXcw7Bt9KqH9RVrUPBpazEDcNUwzHcCcNGin5q86NiRwZD+H5aHRvG\r
+ Wpr5RKYjxkm72NxYx82M6USrlpeMY8EWH8OZ7R/khkw8rMuGyeMFMMHGe8a7EewnB6Is\r
+ DtDg==\r
+Received: by 10.14.209.129 with SMTP id s1mr21139320eeo.24.1346672403417;\r
+ Mon, 03 Sep 2012 04:40:03 -0700 (PDT)\r
+Received: by 10.14.209.129 with SMTP id s1mr21139309eeo.24.1346672403265;\r
+ Mon, 03 Sep 2012 04:40:03 -0700 (PDT)\r
+Received: from mpn-glaptop ([2620:0:105f:5:f2de:f1ff:fe35:1a72])\r
+ by mx.google.com with ESMTPS id 9sm35730580eei.12.2012.09.03.04.40.01\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Mon, 03 Sep 2012 04:40:02 -0700 (PDT)\r
+Sender: Michal Nazarewicz <mpn@google.com>\r
+From: Michal Nazarewicz <mina86@mina86.com>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 4/6] emacs: add support for custom tag changes on\r
+ message/thread archive\r
+In-Reply-To:\r
+ <0907a84d74600df18b8663c28c26f9f7bc2f31c2.1346614915.git.jani@nikula.org>\r
+Organization: http://mina86.com/\r
+References: <cover.1346614915.git.jani@nikula.org>\r
+ <0907a84d74600df18b8663c28c26f9f7bc2f31c2.1346614915.git.jani@nikula.org>\r
+User-Agent: Notmuch/0.14+2~g416b120 (http://notmuchmail.org) Emacs/24.2.50.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd; KFrfMCylc}gc??'U2j,!8%xdD\r
+Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC\r
+X-PGP: 50751FF4\r
+X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4\r
+Date: Mon, 03 Sep 2012 13:39:56 +0200\r
+Message-ID: <xa1tfw6zwd0z.fsf@mina86.com>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+X-Gm-Message-State: ALoCoQmmlCKwMvDnCNUo1eWGicHZSIPhcn2Apw53Z7ybJuNozeb9pfMX3wxvMN/7d9Sq244BqZt+doPXmPQXD4EKUhFN0I5dTeUMixMZsKMYoiODUO9dQlR1l3h4EPx2GROMEMkw+qTe46RKQjbrNegsTywuG9xW3S1p3Rh0DArWse6x9uj/FO16A65OVIJU0yG6WkHK94S5\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, 03 Sep 2012 11:40:05 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Jani Nikula <jani@nikula.org> writes:\r
+> Add support for customization of the tag changes that are applied when\r
+> a message or a thread is archived. Instead of hard-coded removal of\r
+> the "inbox" tag, the user can now specify a list of tag changes to\r
+> perform.\r
+\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index ce5ea6f..e701aec 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -1748,18 +1748,20 @@ argument, hide all of the messages."\r
+> (defun notmuch-show-archive-thread (&optional unarchive)\r
+> "Archive each message in thread.\r
+>=20=20\r
+> -Archive each message currently shown by removing the \"inbox\"\r
+> -tag from each. If a prefix argument is given, the messages will\r
+> -be \"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
+> -removed).\r
+> +Archive each message currently shown by applying the tag changes\r
+> +in `notmuch-archive-tags' to each (remove the \"inbox\" tag by\r
+> +default). If a prefix argument is given, the messages will be\r
+> +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'\r
+> +will be reversed.\r
+>=20=20\r
+> Note: This command is safe from any race condition of new messages\r
+> being delivered to the same thread. It does not archive the\r
+> entire thread, but only the messages shown in the current\r
+> buffer."\r
+> (interactive "P")\r
+> - (let ((op (if unarchive "+" "-")))\r
+> - (notmuch-show-tag-all (concat op "inbox"))))\r
+> + (when notmuch-archive-tags\r
+\r
+Strictly speaking (when) should not be needed here (an in the following\r
+changes). Or is it?\r
+\r
+> + (notmuch-show-tag-all\r
+> + (notmuch-tag-change-list notmuch-archive-tags unarchive))))\r
+>=20=20\r
+> (defun notmuch-show-archive-thread-then-next ()\r
+> "Archive all messages in the current buffer, then show next thread fro=\r
+m search."\r
+> @@ -1774,14 +1776,17 @@ buffer."\r
+> (notmuch-show-next-thread))\r
+>=20=20\r
+> (defun notmuch-show-archive-message (&optional unarchive)\r
+> - "Archive the current message (remove \"inbox\" tag).\r
+> + "Archive the current message.\r
+>=20=20\r
+> -If a prefix argument is given, the message will be\r
+> -\"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
+> -removed)."\r
+> +Archive the current message by applying the tag changes in\r
+> +`notmuch-archive-tags' to it (remove the \"inbox\" tag by\r
+> +default). If a prefix argument is given, the message will be\r
+> +\"unarchived\", i.e. the tag changes in `notmuch-archive-tags'\r
+> +will be reversed."\r
+> (interactive "P")\r
+> - (let ((op (if unarchive "+" "-")))\r
+> - (notmuch-show-tag-message (concat op "inbox"))))\r
+> + (when notmuch-archive-tags\r
+> + (apply 'notmuch-show-tag-message\r
+> + (notmuch-tag-change-list notmuch-archive-tags unarchive))))\r
+>=20=20\r
+> (defun notmuch-show-archive-message-then-next-or-exit ()\r
+> "Archive the current message, then show the next open message in the c=\r
+urrent thread.\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index 1c43d3e..64caa3e 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -594,11 +594,19 @@ See `notmuch-tag' for information on the format of =\r
+TAG-CHANGES."\r
+> (notmuch-search-tag "-"))\r
+>=20=20\r
+> (defun notmuch-search-archive-thread ()\r
+> - "Archive the currently selected thread (remove its \"inbox\" tag).\r
+> + "Archive the currently selected thread.\r
+> +\r
+> +Archive each message in the currently selected thread by applying\r
+> +the tag changes in `notmuch-archive-tags' to each (remove the\r
+> +\"inbox\" tag by default). If a prefix argument is given, the\r
+> +messages will be \"unarchived\" (i.e. the tag changes in\r
+> +`notmuch-archive-tags' will be reversed).\r
+>=20=20\r
+> This function advances the next thread when finished."\r
+> (interactive)\r
+> - (notmuch-search-tag '("-inbox"))\r
+> + (when notmuch-archive-tags\r
+> + (notmuch-search-tag\r
+> + (notmuch-tag-change-list notmuch-archive-tags)))\r
+> (notmuch-search-next-thread))\r
+>=20=20\r
+> (defun notmuch-search-update-result (result &optional pos)\r
+> --=20\r
+> 1.7.9.5\r
+>\r
+\r
+--=20\r
+Best regards, _ _\r
+.o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o\r
+..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz =\r
+ (o o)\r
+ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--\r
+--=-=-=\r
+Content-Type: multipart/signed; boundary="==-=-=";\r
+ micalg=pgp-sha1; protocol="application/pgp-signature"\r
+\r
+--==-=-=\r
+Content-Type: text/plain\r
+\r
+\r
+--==-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iQIcBAEBAgAGBQJQRJcMAAoJECBgQBJQdR/0/vAP+QGmFTurOYg3/AZL595B5ABD\r
+JdvclbsN1NTvZM3sJu4qJ9+G1Ewio5SkO9T5d/Ol8IArxz27Lmg1Grq20CpxCJxQ\r
+HzqsSkHu4HGdep57378n0qF3jdcJmaChbzjML0pP+IPng3fgW2r8B2O0R981NbRe\r
+kYF0ZJXnK6PJM1YlkQvjLcEMqV53zW/HpS2R+wVB6Vig5LBaiATW4yDjym+XhMIh\r
+aDXCZsNujd1Rki6Kw7vHUPyr6x56gEf1hM2NkdsWad1+LIIJStwfRME6R3rwKZe5\r
+8xfDf+GhjxVVLzSZOFE5zAagDBd/ML0FHE5n5hNx9XThMLojODjpalmux1Pul+0p\r
+uStPgdmed5UYsh04SBzPpdEBzIN6mMJ9jq8PjDc1yalIP7CaMBQiO9tBr88p2bF7\r
+6spKaiwICE45YV0B5wfNeDIaOkpYq/E0QZFuKcQ4CYrOmtk5EoEqyhd0WlZ6hDxu\r
+J28bpvmDZMgjsPITKWuSQBpeL+N0upqPgTuSSgO/LnwBN5KGSnqCcykC79Iz0nst\r
+Xioup3o62Nif0hLluKuqNQ1VRXE9dwlvq6ayRZNQQgrKfehzMkV25PY1bkAYSlBx\r
+U5UwQymTQpX88rsAfCvLz3E6EJesNIkexcYAKNtOrE2vVuf6Q0NdlFa1fW6UxDcw\r
+iL/dt3xsQPlgR/4EB4Xo\r
+=9lOb\r
+-----END PGP SIGNATURE-----\r
+--==-=-=--\r
+\r
+--=-=-=--\r