Re: [PATCH 8/6] emacs: use message ids instead of thread id in `notmuch-show-operate...
authorAustin Clements <amdragon@MIT.EDU>
Sun, 29 Jan 2012 23:11:20 +0000 (18:11 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:32 +0000 (09:43 -0800)
03/8f44bcfe282868cfb8e7bffb90419f50160ad6 [new file with mode: 0644]

diff --git a/03/8f44bcfe282868cfb8e7bffb90419f50160ad6 b/03/8f44bcfe282868cfb8e7bffb90419f50160ad6
new file mode 100644 (file)
index 0000000..b1966ff
--- /dev/null
@@ -0,0 +1,152 @@
+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 3B038429E57\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 15:12:11 -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 mxfpL+cXU-Mn for <notmuch@notmuchmail.org>;\r
+       Sun, 29 Jan 2012 15:12:10 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
+       [18.9.25.14])\r
+       by olra.theworths.org (Postfix) with ESMTP id A7761429E54\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 15:12:10 -0800 (PST)\r
+X-AuditID: 1209190e-b7f7c6d0000008c3-cd-4f25d24aec92\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 33.72.02243.A42D52F4; Sun, 29 Jan 2012 18:12:10 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q0TNC9WB020541; \r
+       Sun, 29 Jan 2012 18:12:10 -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.6/8.12.4) with ESMTP id q0TNC8bB024487\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 29 Jan 2012 18:12:09 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1Rrdu4-00008t-JZ; Sun, 29 Jan 2012 18:11:20 -0500\r
+Date: Sun, 29 Jan 2012 18:11:20 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+Subject: Re: [PATCH 8/6] emacs: use message ids instead of thread id in\r
+       `notmuch-show-operate-all'\r
+Message-ID: <20120129231120.GJ17991@mit.edu>\r
+References: <1327725684-5887-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+       <1327730348-6466-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1327730348-6466-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFvrHIsWRmVeSWpSXmKPExsUixG6nrut1SdXfoG2+kMXVrf3sFtdvzmR2\r
+       YPLYOesuu8ezVbeYA5iiuGxSUnMyy1KL9O0SuDIaP/kXtItVnLj3kLGB8Z5gFyMHh4SAicSq\r
+       A7FdjJxAppjEhXvr2UBsIYF9jBKrD2VB2BsYJa78jYewTzJJvH8Q3sXIBWQvYZQ4dW0eE8gc\r
+       FgFVifffdUFq2AQ0JLbtX84IYosIGErcuviKGcRmFpCW+Pa7mQnEFhZIkXj94B7YLl4BHYmb\r
+       b5ezQczsZJS4/Pk1C0RCUOLkzCcsEM1aEjf+vQTbBTJo+T8OEJNTwEvi1EI+kApRARWJKSe3\r
+       sU1gFJqFpHkWkuZZCM0LGJlXMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Rrr5WaW6KWmlG5iBAUz\r
+       pyTfDsavB5UOMQpwMCrx8CquUPEXYk0sK67MPcQoycGkJMobeEHVX4gvKT+lMiOxOCO+qDQn\r
+       tfgQowQHs5II75xlQDnelMTKqtSifJiUNAeLkjivmtY7PyGB9MSS1OzU1ILUIpisDAeHkgTv\r
+       0YtAjYJFqempFWmZOSUIaSYOTpDhPEDDL4HU8BYXJOYWZ6ZD5E8xKkqJ814FSQiAJDJK8+B6\r
+       YcnmFaM40CvCvPNAqniAiQqu+xXQYCagwc8ZwAaXJCKkpBoYN53wOtmk/jLx7nrnxgMGK8Un\r
+       LmE071fwPHmlfI2S0GzvIxv8GXPXVzpwOMewRFc0/y++y29XuiJeV2zL9N3zzDcc36P278eb\r
+       /YsLjnXl/3xnpSSfOJOxV8LMu+D3mnph9fkHfx7dIftVpWvbS2UJYQ2D7ikOgh+5vri7fOq+\r
+       clF22nGHOes5lViKMxINtZiLihMBxTwphREDAAA=\r
+Cc: 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: Sun, 29 Jan 2012 23:12:11 -0000\r
+\r
+Eighth in the increasingly inaccurately named six patch series...\r
+\r
+Quoth Dmitry Kurochkin on Jan 28 at  9:59 am:\r
+> Before the change, `notmuch-show-operate-all' used thread id for\r
+> "notmuch tag" search.  This could result in tagging unexpected\r
+> messages that were added to the thread after the notmuch-show buffer\r
+> was created.  The patch changes `notmuch-show-operate-all' to use ids\r
+> of shown messages to fix this.\r
+\r
+Are you planning to roll this into your earlier patch?\r
+\r
+> ---\r
+>  emacs/notmuch-show.el |   23 ++++++++++++++++++++++-\r
+>  1 files changed, 22 insertions(+), 1 deletions(-)\r
+> \r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 2ca4d92..e606224 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -1170,6 +1170,15 @@ All currently available key bindings:\r
+>      (notmuch-show-move-to-message-top)\r
+>      t))\r
+>  \r
+> +(defun notmuch-show-mapc (function)\r
+> +  "Iterate through all messages with\r
+> +`notmuch-show-goto-message-next' and call `function' for side\r
+> +effects."\r
+\r
+`function' should be FUNCTION.\r
+\r
+> +  (save-excursion\r
+> +    (goto-char (point-min))\r
+> +    (loop do (funcall function)\r
+> +      while (notmuch-show-goto-message-next))))\r
+> +\r
+>  ;; Functions relating to the visibility of messages and their\r
+>  ;; components.\r
+>  \r
+> @@ -1222,6 +1231,18 @@ Some useful entries are:\r
+>    "Return the message id of the current message."\r
+>    (concat "id:\"" (notmuch-show-get-prop :id) "\""))\r
+>  \r
+> +(defun notmuch-show-get-messages-ids ()\r
+> +  "Return all message ids of currently shown messages."\r
+\r
+"currently shown" could mean visible on the screen, which is not what\r
+you mean.  You also don't mean "open messages".  Maybe "Return all\r
+message ids of messages in this show buffer"?\r
+\r
+> +  (let ((message-ids))\r
+> +    (notmuch-show-mapc\r
+> +     (lambda () (push (notmuch-show-get-message-id) message-ids)))\r
+> +    message-ids))\r
+> +\r
+> +(defun notmuch-show-get-messages-ids-search ()\r
+> +  "Return a search string for all message ids of currently shown\r
+> +messages."\r
+\r
+Same.\r
+\r
+> +  (mapconcat 'identity (notmuch-show-get-messages-ids) " or "))\r
+> +\r
+>  ;; dme: Would it make sense to use a macro for many of these?\r
+>  \r
+>  (defun notmuch-show-get-filename ()\r
+> @@ -1496,7 +1517,7 @@ i.e. a list of tags to change with '+' and '-' prefixes."\r
+>  `Changed-tags' is a list of tag operations for \"notmuch tag\",\r
+>  i.e. a list of tags to change with '+' and '-' prefixes."\r
+>    (interactive (notmuch-select-tags-with-completion nil notmuch-show-thread-id))\r
+> -  (apply 'notmuch-tag notmuch-show-thread-id changed-tags)\r
+> +  (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) changed-tags)\r
+>    (save-excursion\r
+>      (goto-char (point-min))\r
+>      (loop do (let* ((current-tags (notmuch-show-get-tags))\r