--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 8CDD7431FBF\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 17:31: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 U7SUFW4G8qA7 for <notmuch@notmuchmail.org>;\r
+ Tue, 11 Feb 2014 17:30:53 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu\r
+ [18.7.68.37])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 0338B431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 11 Feb 2014 17:30:52 -0800 (PST)\r
+X-AuditID: 12074425-f79906d000000cf9-f9-52facecc1d8c\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ (using TLS with cipher AES256-SHA (256/256 bits))\r
+ (Client did not present a certificate)\r
+ by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 6D.E9.03321.CCECAF25; Tue, 11 Feb 2014 20:30:52 -0500 (EST)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s1C1UoBY027104; \r
+ Tue, 11 Feb 2014 20:30:51 -0500\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s1C1Unj9005196\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Tue, 11 Feb 2014 20:30:50 -0500\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1WDOf2-0003RE-Vp; Tue, 11 Feb 2014 20:30:49 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 6/7] emacs: search: use orig-tags in search\r
+In-Reply-To: <1390087855-26194-7-git-send-email-markwalters1009@gmail.com>\r
+References: <1390087855-26194-1-git-send-email-markwalters1009@gmail.com>\r
+ <1390087855-26194-7-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Notmuch/0.17~rc2+14~g06f47e0 (http://notmuchmail.org) Emacs/23.4.1\r
+ (i486-pc-linux-gnu)\r
+Date: Tue, 11 Feb 2014 20:30:48 -0500\r
+Message-ID: <87lhxhm81j.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsUixG6nonvm3K8gg+2fWS1Wz+WxuH5zJrMD\r
+ k8fOWXfZPZ6tusUcwBTFZZOSmpNZllqkb5fAlfH/YhtrwUuhiv99f9gbGHv5uxg5OSQETCTO\r
+ N7xmgrDFJC7cW8/WxcjFISQwm0ni998vTBDORkaJ/ivPWCGc00wSC15MZIZwljBKbJ+5lxWk\r
+ n01AQ2Lb/uWMILaIgKvE02+fmUFsYQF7iTc7JwPN5eDgFPCSOLqlAqK3nVHi4NunYDWiAkkS\r
+ p6f+ZgWpYRFQlfhx0AIkzAt03rN/x9ggbEGJkzOfsIDYzAJaEjf+vWSawCgwC0lqFpLUAkam\r
+ VYyyKblVurmJmTnFqcm6xcmJeXmpRboWermZJXqpKaWbGMEB6aK6g3HCIaVDjAIcjEo8vIKL\r
+ fgUJsSaWFVfmHmKU5GBSEuUNOAYU4kvKT6nMSCzOiC8qzUktPsQowcGsJMKrfwIox5uSWFmV\r
+ WpQPk5LmYFES5621AEoJpCeWpGanphakFsFkZTg4lCR4f54BygoWpaanVqRl5pQgpJk4OEGG\r
+ 8wAN/3MKZHhxQWJucWY6RP4Uo6KUOK/WWZDRIImM0jy4XljCeMUoDvSKMK8myAoeYLKB634F\r
+ NJgJaHB/NtjgkkSElFQDI29H294ZSbOsPp1liWcO9ZlZcCyzSof9H2/3hlJ2O5PZ2y9ees/S\r
+ I2o06eKzHIuqWsb78ucrw31XlpqbP35wwPHMQvEzUQe2zP9zwHubVcseq/YHpVwv3+2q8oub\r
+ plI/Uavr3VVXnU1Jwh7m6e8KjCs2HI6NLOp7vq0/7VdQWIfo2XjpgqStSizFGYmGWsxFxYkA\r
+ tTKOS/MCAAA=\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: Wed, 12 Feb 2014 01:31:00 -0000\r
+\r
+On Sat, 18 Jan 2014, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> This uses the recent functionality to show the tag changes in the\r
+> search buffer. Currently this is only used to show changes the search\r
+> buffer makes itself: i.e., it does not make display any changes\r
+> reflecting tagging done by other notmuch-buffers.\r
+> ---\r
+> emacs/notmuch.el | 12 +++++++++---\r
+> 1 files changed, 9 insertions(+), 3 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index 1436e5a..f0ea5d4 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -753,14 +753,20 @@ non-authors is found, assume that all of the authors match."\r
+> format-string (notmuch-sanitize (plist-get result :authors))))\r
+> \r
+> ((string-equal field "tags")\r
+> - (let ((tags (plist-get result :tags)))\r
+> - (insert (format format-string (notmuch-tag-format-tags tags tags)))))))\r
+> + (let ((tags (plist-get result :tags))\r
+> + (orig-tags (plist-get result :orig-tags)))\r
+> + (insert (format format-string (notmuch-tag-format-tags tags orig-tags)))))))\r
+> \r
+> (defun notmuch-search-show-result (result &optional pos)\r
+> "Insert RESULT at POS or the end of the buffer if POS is null."\r
+> ;; Ignore excluded matches\r
+> (unless (= (plist-get result :matched) 0)\r
+> - (let ((beg (or pos (point-max))))\r
+> + (let ((beg (or pos (point-max)))\r
+> + ;; If we are inserting the result for the first time POS\r
+> + ;; will be nil and we should set orig-tags.\r
+> + (result (if pos\r
+> + result\r
+> + (plist-put result :orig-tags (plist-get result :tags)))))\r
+\r
+This seems rather obtuse. I'd prefer a little wrapper that sits between\r
+`notmuch-sexp-parse-partial-list' and `notmuch-search-show-result' that\r
+adds :orig-tags. The wrapper could also pass (point-max) for pos and\r
+pos could be made a required argument. E.g.,\r
+\r
+(defun notmuch-search-process-result (result)\r
+ ;; Record original tags of this message\r
+ (setq result (plist-put result :orig-tags (plist-get result :tags)))\r
+ ;; Append the result to the search buffer\r
+ (notmuch-search-show-result result (point-max)))\r
+\r
+> (save-excursion\r
+> (goto-char beg)\r
+> (dolist (spec notmuch-search-result-format)\r
+> -- \r
+> 1.7.9.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r