[PATCH 3/5] emacs: notmuch.el remove duplicate tags from get-tags-region
authorMark Walters <markwalters1009@gmail.com>
Fri, 30 Nov 2012 08:21:29 +0000 (08:21 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:11 +0000 (09:51 -0800)
e7/9f1301c76ba7ee17cccbdfe7c9eeed0df4c03c [new file with mode: 0644]

diff --git a/e7/9f1301c76ba7ee17cccbdfe7c9eeed0df4c03c b/e7/9f1301c76ba7ee17cccbdfe7c9eeed0df4c03c
new file mode 100644 (file)
index 0000000..53b41b8
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <markwalters1009@gmail.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 546C0431FD9\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:43 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 BrHByswBpbrx for <notmuch@notmuchmail.org>;\r
+       Fri, 30 Nov 2012 00:23:42 -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 AF65C429E27\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:23 -0800 (PST)\r
+Received: by mail-wi0-f181.google.com with SMTP id hm9so76231wib.2\r
+       for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:23:22 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=DV9aDN/jPOpL+3LntyhDMG45DXtkyWY4MAjhQAHhZXw=;\r
+       b=XxELGCPYx6LURdCCmoAX6ORaeu+CH3GVuYApUJDzkMffUk7azTQ9pIHlsZRcJYGseg\r
+       aUAp90037Fph+Pe5vLVqZQMRZmDFBBV96O0+1zMnBTT5RxTWkzT8ge3W9CDnXxLrThYw\r
+       jYNwoRcIro0boHH1L5EA+5UZ6MNTGbZYYsO1O7kVztViG84UutnQexpvxq5Qvn2mVSNd\r
+       22/zMHUfyqa8KE2rh9VPvXvWS18SZbdtJkDC/BvUBVwU8jMeeJmcu/mFPUXlLPSPHStK\r
+       f2NquKxtzZUpz3QmRcCRWcFKGrxrMIffX4a9AeFzlPftTFSeMHF78gShjaz6KD9FTLfG\r
+       RR3g==\r
+Received: by 10.180.97.137 with SMTP id ea9mr675470wib.13.1354263802585;\r
+       Fri, 30 Nov 2012 00:23:22 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id w5sm5935283wiz.10.2012.11.30.00.23.21\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 30 Nov 2012 00:23:21 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/5] emacs: notmuch.el remove duplicate tags from\r
+       get-tags-region\r
+Date: Fri, 30 Nov 2012 08:21:29 +0000\r
+Message-Id: <1354263691-19715-4-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1354263691-19715-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1354263691-19715-1-git-send-email-markwalters1009@gmail.com>\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, 30 Nov 2012 08:23:43 -0000\r
+\r
+From: markwalters1009 <markwalters1009@gmail.com>\r
+\r
+get-tags-region used to return a list of all tags of all messages with\r
+tags appearing multiple times. This changes it to return a list where\r
+each tag appears at most once. As far as I can see there were no\r
+callers of the old function (but this series adds one!).\r
+---\r
+ emacs/notmuch.el |    5 +++--\r
+ 1 files changed, 3 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index f9454d8..4e6bbcf 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -558,10 +558,11 @@ and will also appear in a buffer named \"*Notmuch errors*\"."\r
+   (plist-get (notmuch-search-get-result pos) :tags))\r
+ \r
+ (defun notmuch-search-get-tags-region (beg end)\r
+-  (let (output)\r
++  (let ((output '()))\r
+     (notmuch-search-foreach-result beg end\r
+       (lambda (pos)\r
+-      (setq output (append output (notmuch-search-get-tags pos)))))\r
++      (mapc (lambda (tag) (add-to-list 'output tag))\r
++            (notmuch-search-get-tags pos))))\r
+     output))\r
+ \r
+ (defun notmuch-search-tag-region (beg end &optional tag-changes)\r
+-- \r
+1.7.9.1\r
+\r