From: Mark Walters Date: Fri, 14 Jun 2013 07:37:52 +0000 (+0100) Subject: [PATCH v3 2/2] contrib: pick: thread tagging (including archiving) implemented X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7cd09ae071f1dbc64b3473212886d82bf042448a;p=notmuch-archives.git [PATCH v3 2/2] contrib: pick: thread tagging (including archiving) implemented --- diff --git a/fe/56192f215aac6376e787b144d138c440c1c2ce b/fe/56192f215aac6376e787b144d138c440c1c2ce new file mode 100644 index 000000000..79b7292dd --- /dev/null +++ b/fe/56192f215aac6376e787b144d138c440c1c2ce @@ -0,0 +1,127 @@ +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 B196B431FC2 + for ; Fri, 14 Jun 2013 00:38:14 -0700 (PDT) +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 9AaSlpLJvJbI for ; + Fri, 14 Jun 2013 00:38:08 -0700 (PDT) +Received: from mail-we0-f169.google.com (mail-we0-f169.google.com + [74.125.82.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 576AE429E34 + for ; Fri, 14 Jun 2013 00:38:02 -0700 (PDT) +Received: by mail-we0-f169.google.com with SMTP id n57so187654wev.28 + for ; Fri, 14 Jun 2013 00:38:01 -0700 (PDT) +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=H+Lbs7e68RvkF5r6GaJRbCVFdkPQWC+uk5cuUE90cD8=; + b=ywPZspvXAl1jrrr+K5Ywv4cdNRznzyrcIC0rOAGl2ClkCjpDYDKv+GiwimE0PM8GJy + lVdC4itmuF6BQ8JJT6PW9/LzfdyTEP8BbHh2yK4BEXT/1XSSPlMlw+4HdfSuq9AU1b/e + sfRtUkKsj/VpDqlO6xA6ktaJuWe2C3NCs2ONcfA2t3BYWGH1t/Wgavo3hElGwjvezIoI + 4MKjMYpEMQzkdSYFdLB/1iU0d3qT74Ne4TuUBLzDwtEM6vY7ply9mRYkBz1tbRpUAEFX + y+7pRSE9kOPadn/1oq2dFbwjNvbUXRQbuLm33egU9hu0F+f7y3vsdJKlMI6lDs2DCsY1 + Gt/w== +X-Received: by 10.180.185.225 with SMTP id ff1mr569546wic.36.1371195481032; + Fri, 14 Jun 2013 00:38:01 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id dz8sm1160353wib.11.2013.06.14.00.37.59 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Fri, 14 Jun 2013 00:38:00 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v3 2/2] contrib: pick: thread tagging (including archiving) + implemented +Date: Fri, 14 Jun 2013 08:37:52 +0100 +Message-Id: <1371195472-441-3-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1371195472-441-1-git-send-email-markwalters1009@gmail.com> +References: <1371195472-441-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, 14 Jun 2013 07:38:15 -0000 + +Previously pick had no actions based on the entire thread: this adds +some. Note in this version '*' is bound to `tag thread' which is not +consistent with search or show. However it still might be the most +natural thing (as it is similar to running * in the show pane). +--- + contrib/notmuch-pick/notmuch-pick.el | 27 +++++++++++++++++++++++++++ + 1 files changed, 27 insertions(+), 0 deletions(-) + +diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el +index af117ba..eeb86d9 100644 +--- a/contrib/notmuch-pick/notmuch-pick.el ++++ b/contrib/notmuch-pick/notmuch-pick.el +@@ -179,6 +179,7 @@ + (define-key map "q" 'notmuch-pick-quit) + (define-key map "x" 'notmuch-pick-quit) + (define-key map "?" 'notmuch-help) ++ (define-key map "A" 'notmuch-pick-archive-thread) + (define-key map "a" 'notmuch-pick-archive-message-then-next) + (define-key map "=" 'notmuch-pick-refresh-view) + (define-key map "s" 'notmuch-pick-to-search) +@@ -194,6 +195,7 @@ + (define-key map "|" 'notmuch-pick-pipe-message) + (define-key map "-" 'notmuch-pick-remove-tag) + (define-key map "+" 'notmuch-pick-add-tag) ++ (define-key map "*" 'notmuch-pick-tag-thread) + (define-key map " " 'notmuch-pick-scroll-or-next) + (define-key map "b" 'notmuch-pick-scroll-message-window-back) + map)) +@@ -604,6 +606,31 @@ than only the current message." + (notmuch-pick-thread-mapcar 'notmuch-pick-get-message-id) + " or ")) + ++(defun notmuch-pick-tag-thread (&optional tag-changes) ++ "Tag all messages in the current thread" ++ (interactive) ++ (when (notmuch-pick-get-message-properties) ++ (let ((tag-changes (notmuch-tag (notmuch-pick-get-messages-ids-thread-search) tag-changes))) ++ (notmuch-pick-thread-mapcar ++ (lambda () (notmuch-pick-tag-update-display tag-changes)))))) ++ ++(defun notmuch-pick-archive-thread (&optional unarchive) ++ "Archive each message in thread. ++ ++Archive each message currently shown by applying the tag changes ++in `notmuch-archive-tags' to each. If a prefix argument is given, ++the messages will be \"unarchived\", i.e. the tag changes in ++`notmuch-archive-tags' will be reversed. ++ ++Note: This command is safe from any race condition of new messages ++being delivered to the same thread. It does not archive the ++entire thread, but only the messages shown in the current ++buffer." ++ (interactive "P") ++ (when notmuch-archive-tags ++ (notmuch-pick-tag-thread ++ (notmuch-tag-change-list notmuch-archive-tags unarchive)))) ++ + ;; Functions below here display the pick buffer itself. + + (defun notmuch-pick-clean-address (address) +-- +1.7.9.1 +