[PATCH v3 3/8] emacs: break out thread navigation from notmuch-show-archive-thread
authorJameson Graef Rollins <jrollins@finestructure.net>
Wed, 25 Jan 2012 00:06:18 +0000 (16:06 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:10 +0000 (09:43 -0800)
2e/0ac93cdc724703077ca9521a029741b0dba877 [new file with mode: 0644]

diff --git a/2e/0ac93cdc724703077ca9521a029741b0dba877 b/2e/0ac93cdc724703077ca9521a029741b0dba877
new file mode 100644 (file)
index 0000000..c6fa99e
--- /dev/null
@@ -0,0 +1,132 @@
+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 ACEB3431FC2\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:30 -0800 (PST)\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 NtVkeURiYjnq for <notmuch@notmuchmail.org>;\r
+       Tue, 24 Jan 2012 16:06:30 -0800 (PST)\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 1225C431FBC\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:30 -0800 (PST)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by earth-doxen-postvirus (Postfix) with ESMTP id BCCA866E016E\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:29 -0800 (PST)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from finestructure.net (DHCP-123-180.caltech.edu [131.215.123.180])\r
+       (Authenticated sender: jrollins)\r
+       by earth-doxen-submit (Postfix) with ESMTP id DD11666E0177\r
+       for <notmuch@notmuchmail.org>; Tue, 24 Jan 2012 16:06:27 -0800 (PST)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id D5DE02FA; Tue, 24 Jan 2012 16:06:27 -0800 (PST)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH v3 3/8] emacs: break out thread navigation from\r
+       notmuch-show-archive-thread\r
+Date: Tue, 24 Jan 2012 16:06:18 -0800\r
+Message-Id: <1327449983-23638-4-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.8.3\r
+In-Reply-To: <1327449983-23638-3-git-send-email-jrollins@finestructure.net>\r
+References: <87pqea24z0.fsf@servo.finestructure.net>\r
+       <1327449983-23638-1-git-send-email-jrollins@finestructure.net>\r
+       <1327449983-23638-2-git-send-email-jrollins@finestructure.net>\r
+       <1327449983-23638-3-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: Wed, 25 Jan 2012 00:06:30 -0000\r
+\r
+This function is now just for archiving the current thread.  A new\r
+function is created to archive-then-next.  The 'a' key binding is\r
+updated accordingly.\r
+\r
+This will allow people to bind to the simple thread archiving function\r
+without the extra navigation.  The archive-thread function now also\r
+takes a prefix to unarchive the current thread (ie. put the whole\r
+thread back in the inbox).\r
+---\r
+ emacs/notmuch-show.el |   23 +++++++++++++++++------\r
+ 1 files changed, 17 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index fb908b0..071e662 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1044,7 +1044,7 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
+       (define-key map "-" 'notmuch-show-remove-tag)\r
+       (define-key map "+" 'notmuch-show-add-tag)\r
+       (define-key map "x" 'notmuch-show-archive-thread-then-exit)\r
+-      (define-key map "a" 'notmuch-show-archive-thread)\r
++      (define-key map "a" 'notmuch-show-archive-thread-then-next)\r
+       (define-key map "N" 'notmuch-show-next-message)\r
+       (define-key map "P" 'notmuch-show-previous-message)\r
+       (define-key map "n" 'notmuch-show-next-open-message)\r
+@@ -1304,7 +1304,7 @@ thread from the search from which this thread was originally\r
+ shown."\r
+   (interactive)\r
+   (if (notmuch-show-advance)\r
+-      (notmuch-show-archive-thread)))\r
++      (notmuch-show-archive-thread-then-next)))\r
\r
+ (defun notmuch-show-rewind ()\r
+   "Backup through the thread, (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).\r
+@@ -1558,8 +1558,12 @@ added."\r
+       (if show-next\r
+         (notmuch-search-show-thread)))))\r
\r
+-(defun notmuch-show-archive-thread ()\r
+-  "Archive each message in thread, then show next thread from search.\r
++(defun notmuch-show-archive-thread (&optional unarchive)\r
++  "Archive each message in thread.\r
++\r
++If a prefix argument is given, the messages will be\r
++\"unarchived\" (ie. the \"inbox\" tag will be added instead of\r
++removed).\r
\r
+ Archive each message currently shown by removing the \"inbox\"\r
+ tag from each. Then kill this buffer and show the next thread\r
+@@ -1569,14 +1573,21 @@ Note: This command is safe from any race condition of new messages\r
+ being delivered to the same thread. It does not archive the\r
+ entire thread, but only the messages shown in the current\r
+ buffer."\r
++  (interactive "P")\r
++  (if unarchive\r
++      (notmuch-show-add-tag-thread "inbox")\r
++    (notmuch-show-remove-tag-thread "inbox")))\r
++\r
++(defun notmuch-show-archive-thread-then-next ()\r
++  "Archive each message in thread, then show next thread from search."\r
+   (interactive)\r
+-  (notmuch-show-remove-tag-thread "inbox")\r
++  (notmuch-show-archive-thread)\r
+   (notmuch-show-next-thread t))\r
\r
+ (defun notmuch-show-archive-thread-then-exit ()\r
+   "Archive each message in thread, then exit back to search results."\r
+   (interactive)\r
+-  (notmuch-show-remove-tag-thread "inbox")\r
++  (notmuch-show-archive-thread)\r
+   (notmuch-show-next-thread))\r
\r
+ (defun notmuch-show-stash-cc ()\r
+-- \r
+1.7.8.3\r
+\r