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