Re: [PATCH 7/8] emacs: modify show tag functions to use new notmuch-tag interface
authorMark Walters <markwalters1009@gmail.com>
Mon, 9 Apr 2012 18:42:20 +0000 (19:42 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:12 +0000 (09:46 -0800)
15/589eb264f8764da92867b14c7e058767ddf08d [new file with mode: 0644]

diff --git a/15/589eb264f8764da92867b14c7e058767ddf08d b/15/589eb264f8764da92867b14c7e058767ddf08d
new file mode 100644 (file)
index 0000000..94e07d9
--- /dev/null
@@ -0,0 +1,151 @@
+Return-Path: <m.walters@qmul.ac.uk>\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 B0C5540CAE4\r
+       for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 11:42:06 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+       tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+       NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 VPUgNIrZDc2p for <notmuch@notmuchmail.org>;\r
+       Mon,  9 Apr 2012 11:42:06 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D14C340CAC7\r
+       for <notmuch@notmuchmail.org>; Mon,  9 Apr 2012 11:42:05 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+       by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1SHJXP-0008GX-Qq; Mon, 09 Apr 2012 19:42:04 +0100\r
+Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
+       helo=localhost)\r
+       by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1SHJXP-0004D0-HY; Mon, 09 Apr 2012 19:42:03 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
+       Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH 7/8] emacs: modify show tag functions to use new\r
+       notmuch-tag interface\r
+In-Reply-To: <1333845338-22960-8-git-send-email-jrollins@finestructure.net>\r
+References: <1333354853-25729-1-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-1-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-2-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-3-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-4-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-5-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-6-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-7-git-send-email-jrollins@finestructure.net>\r
+       <1333845338-22960-8-git-send-email-jrollins@finestructure.net>\r
+User-Agent: Notmuch/0.12+111~g5c30f66 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Mon, 09 Apr 2012 19:42:20 +0100\r
+Message-ID: <87y5q4lpbn.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 94.192.233.223\r
+X-QM-SPAM-Info: Sender has good ham record.  :)\r
+X-QM-Body-MD5: b6ab2e450acd5a52c128883779276f2e (of first 20000 bytes)\r
+X-SpamAssassin-Score: -1.8\r
+X-SpamAssassin-SpamBar: -\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+       determine if it is\r
+       spam. We require at least 5.0 points to mark a message as spam.\r
+       This message scored -1.8 points.\r
+       Summary of the scoring: \r
+       * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
+       *      medium trust\r
+       *      [138.37.6.40 listed in list.dnswl.org]\r
+       * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+       provider *      (markwalters1009[at]gmail.com)\r
+       * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
+       *      domain\r
+       *  0.5 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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: Mon, 09 Apr 2012 18:42:06 -0000\r
+\r
+On Sun, 08 Apr 2012, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
+> The main change here is to modify argument parsing so as to not force\r
+> tag-changes to be a list, and to let notmuch-tag handle prompting the\r
+> user when required.  doc strings are also updated and cleaned up.\r
+\r
+One other comment on this patch is that it would be nice to have a tag\r
+region in show view as well. Of course that is a feature request rather\r
+than a requirement for this patch series!\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+> ---\r
+>  emacs/notmuch-show.el |   26 +++++++++++++++-----------\r
+>  1 files changed, 15 insertions(+), 11 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index a4c313d..69bca02 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -1641,22 +1641,26 @@ TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
+>    (let* ((current-tags (notmuch-show-get-tags))\r
+>       (new-tags (notmuch-update-tags current-tags tag-changes)))\r
+>      (unless (equal current-tags new-tags)\r
+> -      (apply 'notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
+> +      (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes)\r
+>        (notmuch-show-set-tags new-tags))))\r
+>  \r
+> -(defun notmuch-show-tag (&optional initial-input)\r
+> -  "Change tags for the current message, read input from the minibuffer."\r
+> +(defun notmuch-show-tag (&optional tag-changes)\r
+> +  "Change tags for the current message.\r
+> +\r
+> +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+>    (interactive)\r
+> -  (let ((tag-changes (notmuch-read-tag-changes\r
+> -                  initial-input (notmuch-show-get-message-id))))\r
+> -    (apply 'notmuch-show-tag-message tag-changes)))\r
+> +  (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-message-id) tag-changes))\r
+> +  (let* ((current-tags (notmuch-show-get-tags))\r
+> +     (new-tags (notmuch-update-tags current-tags tag-changes)))\r
+> +    (unless (equal current-tags new-tags)\r
+> +      (notmuch-show-set-tags new-tags))))\r
+>  \r
+> -(defun notmuch-show-tag-all (&rest tag-changes)\r
+> -  "Change tags for all messages in the current buffer.\r
+> +(defun notmuch-show-tag-all (&optional tag-changes)\r
+> +  "Change tags for all messages in the current show buffer.\r
+>  \r
+> -TAG-CHANGES is a list of tag operations for `notmuch-tag'."\r
+> -  (interactive (notmuch-read-tag-changes nil notmuch-show-thread-id))\r
+> -  (apply 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes)\r
+> +See `notmuch-tag' for information on the format of TAG-CHANGES."\r
+> +  (interactive)\r
+> +  (setq tag-changes (funcall 'notmuch-tag (notmuch-show-get-messages-ids-search) tag-changes))\r
+>    (notmuch-show-mapc\r
+>     (lambda ()\r
+>       (let* ((current-tags (notmuch-show-get-tags))\r
+> -- \r
+> 1.7.9.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r