From 55337baf409d5fc0a398990109c2bfdc4d26ca48 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Fri, 14 Jun 2013 00:36:58 +0100 Subject: [PATCH] [PATCH v2 2/2] contrib: pick: thread tagging (including archiving) implemented --- 9d/e157bf25842735da3da6f21d9801dad369e811 | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 9d/e157bf25842735da3da6f21d9801dad369e811 diff --git a/9d/e157bf25842735da3da6f21d9801dad369e811 b/9d/e157bf25842735da3da6f21d9801dad369e811 new file mode 100644 index 000000000..40277ad08 --- /dev/null +++ b/9d/e157bf25842735da3da6f21d9801dad369e811 @@ -0,0 +1,126 @@ +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 C23DE429E43 + for ; Thu, 13 Jun 2013 16:37:22 -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 o3glJMJ6HnkS for ; + Thu, 13 Jun 2013 16:37:18 -0700 (PDT) +Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com + [74.125.83.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + CA1EB429E34 for ; Thu, 13 Jun 2013 16:37:15 -0700 + (PDT) +Received: by mail-ee0-f43.google.com with SMTP id l10so4764387eei.16 + for ; Thu, 13 Jun 2013 16:37:14 -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=s9PlFSvD719GHhbQA8nvfdMYkp4ruD2IPEKueoyaF8w=; + b=Xr3ydZG0My59EjWB+v/4WexwdKbJBL8Ye/iTNrUphnF5Q0iDrA5B0y7StAPTHy02Fh + Vss0ihvjMH2ADk9lmKiKQywwCUOuBLxdmD6rTxj3RzwS4gSVvUrNZme2Vql96S6I5U+n + 3Di+fkBwZKMqpaRAkMQC/r9EX/UH+9ALE6OzgE4TbYTlsxmCBhtAFZLqZf+7mvkp9P0x + OY+3VfG25UCXwTd3KJLH9Iedvf5QGAbmSvOc3cbN46JxHy4ChMtG67w/tBLFyx/8GnmF + VJ4uuLoXXeCp8temH69jywNPSWvL/ZtnReFeC50V6+yH+5kbK3/m7fgRlbpKWMi9jODz + qQFA== +X-Received: by 10.14.5.201 with SMTP id 49mr3758019eel.57.1371166634695; + Thu, 13 Jun 2013 16:37:14 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + u11sm46884154eev.12.2013.06.13.16.37.13 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 13 Jun 2013 16:37:13 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v2 2/2] contrib: pick: thread tagging (including archiving) + implemented +Date: Fri, 14 Jun 2013 00:36:58 +0100 +Message-Id: <1371166618-27196-3-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1371166618-27196-1-git-send-email-markwalters1009@gmail.com> +References: <1371166618-27196-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: Thu, 13 Jun 2013 23:37:23 -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 | 26 ++++++++++++++++++++++++++ + 1 files changed, 26 insertions(+), 0 deletions(-) + +diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el +index 8030842..642db79 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,30 @@ 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) ++ (setq 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 + -- 2.26.2