[PATCH v2 4/6] emacs: add optional predicate arg to `notmuch-show-mapc'
authorPieter Praet <pieter@praet.org>
Fri, 24 Feb 2012 22:30:38 +0000 (23:30 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:54 +0000 (09:44 -0800)
0d/68f90c1c37cb259f387ff251e3bfd7edb566fd [new file with mode: 0644]

diff --git a/0d/68f90c1c37cb259f387ff251e3bfd7edb566fd b/0d/68f90c1c37cb259f387ff251e3bfd7edb566fd
new file mode 100644 (file)
index 0000000..dc72467
--- /dev/null
@@ -0,0 +1,108 @@
+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 89357416017\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Feb 2012 14:33:32 -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 WGIxG7V3Gd4X for <notmuch@notmuchmail.org>;\r
+       Fri, 24 Feb 2012 14:33:31 -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 321D9415D32\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Feb 2012 14:33:30 -0800 (PST)\r
+Received: by wibhi8 with SMTP id hi8so2008668wib.26\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Feb 2012 14:33:28 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of pieter@praet.org designates\r
+       10.180.86.134 as permitted sender) client-ip=10.180.86.134; \r
+Authentication-Results: mr.google.com;\r
+       spf=pass (google.com: domain of pieter@praet.org\r
+       designates 10.180.86.134 as permitted sender)\r
+       smtp.mail=pieter@praet.org\r
+Received: from mr.google.com ([10.180.86.134])\r
+       by 10.180.86.134 with SMTP id p6mr8878423wiz.0.1330122808960 (num_hops\r
+       = 1); Fri, 24 Feb 2012 14:33:28 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.180.86.134 with SMTP id p6mr7172366wiz.0.1330122808879;\r
+       Fri, 24 Feb 2012 14:33:28 -0800 (PST)\r
+Received: from localhost ([109.131.181.26])\r
+       by mx.google.com with ESMTPS id cs4sm14678582wib.8.2012.02.24.14.33.28\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 24 Feb 2012 14:33:28 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: David Bremner <david@tethera.net>,\r
+       Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+Subject: [PATCH v2 4/6] emacs: add optional predicate arg to\r
+       `notmuch-show-mapc'\r
+Date: Fri, 24 Feb 2012 23:30:38 +0100\r
+Message-Id: <1330122640-18895-5-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <1330122640-18895-1-git-send-email-pieter@praet.org>\r
+References: <87wr7xqpuf.fsf@rocinante.cs.unb.ca>\r
+       <1330122640-18895-1-git-send-email-pieter@praet.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnkNJMxbNjmSVpFTNz2xGhCnfMyK3XRwvEGsz9WKbZ1B8M20ULZ52MsgHXyg+ZEaYt+YtlT\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: Fri, 24 Feb 2012 22:33:32 -0000\r
+\r
+* emacs/notmuch-show.el (notmuch-show-mapc):\r
+\r
+  If provided with optional argument PREDICATE, only call\r
+  FUNCTION if calling PREDICATE returns non-nil.\r
+\r
+  Also correct original docstring: 's/thread/buffer/'.\r
+---\r
+ emacs/notmuch-show.el |   14 ++++++++++----\r
+ 1 files changed, 10 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index aa9ccee..6adbdc0 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1272,13 +1272,19 @@ (defun notmuch-show-goto-message-previous ()\r
+     (notmuch-show-move-to-message-top)\r
+     t))\r
+ \r
+-(defun notmuch-show-mapc (function)\r
+-  "Iterate through all messages in the current thread with\r
++(defun notmuch-show-mapc (function &optional predicate)\r
++  "Iterate through all messages in the current buffer with\r
+ `notmuch-show-goto-message-next' and call FUNCTION for side\r
+-effects."\r
++effects.\r
++\r
++If provided with optional argument PREDICATE, only call\r
++FUNCTION if calling PREDICATE returns non-nil."\r
+   (save-excursion\r
+     (goto-char (point-min))\r
+-    (loop do (funcall function)\r
++    (loop do (if predicate\r
++               (if (funcall predicate)\r
++                   (funcall function))\r
++             (funcall function))\r
+         while (notmuch-show-goto-message-next))))\r
+ \r
+ ;; Functions relating to the visibility of messages and their\r
+-- \r
+1.7.8.1\r
+\r