[PATCH 4/5] emacs: modify show tag functions to use new notmuch-tag interface
authorJameson Graef Rollins <jrollins@finestructure.net>
Sat, 14 Apr 2012 18:52:53 +0000 (11:52 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:22 +0000 (09:46 -0800)
02/ba944aeceabe4ede874bfc4e0c9046e52c060b [new file with mode: 0644]

diff --git a/02/ba944aeceabe4ede874bfc4e0c9046e52c060b b/02/ba944aeceabe4ede874bfc4e0c9046e52c060b
new file mode 100644 (file)
index 0000000..289056d
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <jrollins@finestructure.net>\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 CAAEF431FD0\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[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 E+OSpVY-GIdW for <notmuch@notmuchmail.org>;\r
+       Sat, 14 Apr 2012 11:53:05 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9ABB6431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:05 -0700 (PDT)\r
+Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by fire-doxen-postvirus (Postfix) with ESMTP id 591982E50D6C\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:03 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
+Received: from finestructure.net (unknown [76.89.193.65])\r
+       (Authenticated sender: jrollins)\r
+       by fire-doxen-submit (Postfix) with ESMTP id 8CB492E50D6E\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 11:53:01 -0700 (PDT)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id 319AC698; Sat, 14 Apr 2012 11:53:01 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 4/5] emacs: modify show tag functions to use new notmuch-tag\r
+       interface\r
+Date: Sat, 14 Apr 2012 11:52:53 -0700\r
+Message-Id: <1334429574-12918-5-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To: <1334429574-12918-4-git-send-email-jrollins@finestructure.net>\r
+References: <1333845338-22960-1-git-send-email-jrollins@finestructure.net>\r
+       <1334429574-12918-1-git-send-email-jrollins@finestructure.net>\r
+       <1334429574-12918-2-git-send-email-jrollins@finestructure.net>\r
+       <1334429574-12918-3-git-send-email-jrollins@finestructure.net>\r
+       <1334429574-12918-4-git-send-email-jrollins@finestructure.net>\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: Sat, 14 Apr 2012 18:53:09 -0000\r
+\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
+ emacs/notmuch-show.el |   26 +++++++++++++++-----------\r
+ 1 file 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.5\r
+\r