From 5a1e76e1b787ebc6f065b5ce2be1fcbce2b22943 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 25 Aug 2013 20:55:33 +0100 Subject: [PATCH] [Patch v4 2/3] contrib: pick: thread tagging (including archiving) implemented --- 80/ff947094dc67338d0a94191a432ca41b54f6a4 | 127 ++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 80/ff947094dc67338d0a94191a432ca41b54f6a4 diff --git a/80/ff947094dc67338d0a94191a432ca41b54f6a4 b/80/ff947094dc67338d0a94191a432ca41b54f6a4 new file mode 100644 index 000000000..9a27f2cd8 --- /dev/null +++ b/80/ff947094dc67338d0a94191a432ca41b54f6a4 @@ -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 24ECB431FCF + for ; Mon, 26 Aug 2013 10:31:27 -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 XN8UU7-f+CDG for ; + Mon, 26 Aug 2013 10:31:20 -0700 (PDT) +Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com + [209.85.212.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 64C2B431FC0 + for ; Mon, 26 Aug 2013 10:31:20 -0700 (PDT) +Received: by mail-wi0-f174.google.com with SMTP id c10so212587wiw.1 + for ; Mon, 26 Aug 2013 10:31:16 -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:in-reply-to:references; + bh=1d5wWWKtE1EVmQNMYg9pd8E+3Vr4SPW27C9Sf6CqwjM=; + b=eZP1JkQgDptFQuiGYbsRXoiaTkHktMS93WpUERkmWJR2g4pcl0v+vxZMcSc56j9e7h + ja1WY9QqESAHjy1ipPb+cfCFM+QgubEB3p8S/55GWdPz/SEgKN06GTdrISKi895qOX5y + 6MaCk3KXRxhksWCiwRBdLA94QSFWRIQFJap4XlrbgGFzh/Fl+/rV5+n5bLchzXOFvtzL + WmpmNpLW0xGag0ADo9SfgcmY/OjZTqVBG37AK1a23ynQmCd1vZZ7CLDsYQRHyzQKXa7s + awAn2IP7oezOcuiS2fV0JMOTsk7f5h+Tv2+AZ0pJe5/aWIKmNcylUIJB9yc5I0eSXhOn + oY7Q== +X-Received: by 10.180.92.98 with SMTP id cl2mr5088497wib.15.1377460545324; + Sun, 25 Aug 2013 12:55:45 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + jc18sm13278986wic.5.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 25 Aug 2013 12:55:44 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [Patch v4 2/3] contrib: pick: thread tagging (including archiving) + implemented +Date: Sun, 25 Aug 2013 20:55:33 +0100 +Message-Id: <1377460534-6022-3-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1377460534-6022-1-git-send-email-markwalters1009@gmail.com> +References: <1377460534-6022-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: Mon, 26 Aug 2013 17:31:27 -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 fea118f..258cfc3 100644 +--- a/contrib/notmuch-pick/notmuch-pick.el ++++ b/contrib/notmuch-pick/notmuch-pick.el +@@ -246,6 +246,7 @@ FUNC." + ;; The main pick bindings + (define-key map "q" 'notmuch-pick-quit) + (define-key map "x" 'notmuch-pick-quit) ++ (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) +@@ -256,6 +257,7 @@ FUNC." + (define-key map "P" 'notmuch-pick-prev-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)) +@@ -620,6 +622,31 @@ message will be \"unarchived\", i.e. the tag changes in + (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 + -- 2.26.2