unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH v3 3/8] emacs: break out thread navigation from notmuch-show-archive-thread
Date: Tue, 24 Jan 2012 16:06:18 -0800	[thread overview]
Message-ID: <1327449983-23638-4-git-send-email-jrollins@finestructure.net> (raw)
In-Reply-To: <1327449983-23638-3-git-send-email-jrollins@finestructure.net>

This function is now just for archiving the current thread.  A new
function is created to archive-then-next.  The 'a' key binding is
updated accordingly.

This will allow people to bind to the simple thread archiving function
without the extra navigation.  The archive-thread function now also
takes a prefix to unarchive the current thread (ie. put the whole
thread back in the inbox).
---
 emacs/notmuch-show.el |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index fb908b0..071e662 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1044,7 +1044,7 @@ thread id.  If a prefix is given, crypto processing is toggled."
 	(define-key map "-" 'notmuch-show-remove-tag)
 	(define-key map "+" 'notmuch-show-add-tag)
 	(define-key map "x" 'notmuch-show-archive-thread-then-exit)
-	(define-key map "a" 'notmuch-show-archive-thread)
+	(define-key map "a" 'notmuch-show-archive-thread-then-next)
 	(define-key map "N" 'notmuch-show-next-message)
 	(define-key map "P" 'notmuch-show-previous-message)
 	(define-key map "n" 'notmuch-show-next-open-message)
@@ -1304,7 +1304,7 @@ thread from the search from which this thread was originally
 shown."
   (interactive)
   (if (notmuch-show-advance)
-      (notmuch-show-archive-thread)))
+      (notmuch-show-archive-thread-then-next)))
 
 (defun notmuch-show-rewind ()
   "Backup through the thread, (reverse scrolling compared to \\[notmuch-show-advance-and-archive]).
@@ -1558,8 +1558,12 @@ added."
       (if show-next
 	  (notmuch-search-show-thread)))))
 
-(defun notmuch-show-archive-thread ()
-  "Archive each message in thread, then show next thread from search.
+(defun notmuch-show-archive-thread (&optional unarchive)
+  "Archive each message in thread.
+
+If a prefix argument is given, the messages will be
+\"unarchived\" (ie. the \"inbox\" tag will be added instead of
+removed).
 
 Archive each message currently shown by removing the \"inbox\"
 tag from each. Then kill this buffer and show the next thread
@@ -1569,14 +1573,21 @@ 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")
+  (if unarchive
+      (notmuch-show-add-tag-thread "inbox")
+    (notmuch-show-remove-tag-thread "inbox")))
+
+(defun notmuch-show-archive-thread-then-next ()
+  "Archive each message in thread, then show next thread from search."
   (interactive)
-  (notmuch-show-remove-tag-thread "inbox")
+  (notmuch-show-archive-thread)
   (notmuch-show-next-thread t))
 
 (defun notmuch-show-archive-thread-then-exit ()
   "Archive each message in thread, then exit back to search results."
   (interactive)
-  (notmuch-show-remove-tag-thread "inbox")
+  (notmuch-show-archive-thread)
   (notmuch-show-next-thread))
 
 (defun notmuch-show-stash-cc ()
-- 
1.7.8.3

  reply	other threads:[~2012-01-25  0:06 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 18:05 show-mode message/thread archiving improvements Jameson Graef Rollins
2012-01-17 18:05 ` [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into two generally useful functions Jameson Graef Rollins
2012-01-17 18:05   ` [PATCH 2/6] emacs: break out thread navigation from notmuch-show-archive-thread Jameson Graef Rollins
2012-01-17 18:05     ` [PATCH 3/6] emacs: add message archiving functions Jameson Graef Rollins
2012-01-17 18:05       ` [PATCH 4/6] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end Jameson Graef Rollins
2012-01-17 18:05         ` [PATCH 5/6] emacs: use pop-at-end functionality in show-archive-message-then-next function Jameson Graef Rollins
2012-01-17 18:05           ` [PATCH 6/6] emacs: modify the default show-mode key bindings for archiving Jameson Graef Rollins
2012-01-18  8:13             ` David Edmondson
2012-01-18  8:12         ` [PATCH 4/6] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end David Edmondson
2012-01-18  8:47           ` Jameson Graef Rollins
2012-01-18  8:56             ` David Edmondson
2012-01-18 18:53               ` Jameson Graef Rollins
2012-01-17 18:43       ` [PATCH] emacs: fix archive thread/message function documentation Jameson Graef Rollins
2012-01-17 20:13       ` [PATCH 3/6] emacs: add message archiving functions Aaron Ecay
2012-01-17 20:18         ` Jameson Graef Rollins
2012-01-18  8:09       ` David Edmondson
2012-01-18  8:08     ` [PATCH 2/6] emacs: break out thread navigation from notmuch-show-archive-thread David Edmondson
2012-01-17 20:10   ` [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into two generally useful functions Aaron Ecay
2012-01-17 20:17     ` Jameson Graef Rollins
2012-01-17 20:57       ` Aaron Ecay
2012-01-18  8:14       ` David Edmondson
2012-01-18  8:06   ` David Edmondson
2012-01-17 20:09 ` show-mode message/thread archiving improvements Aaron Ecay
2012-01-23  8:33 ` Jameson Graef Rollins
2012-01-23  8:34   ` [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into two more generally useful functions Jameson Graef Rollins
2012-01-23  8:34     ` [PATCH 2/6] emacs: break out thread navigation from notmuch-show-archive-thread Jameson Graef Rollins
2012-01-23  8:34       ` [PATCH 3/6] emacs: add message archiving functions Jameson Graef Rollins
2012-01-23  8:34         ` [PATCH 4/6] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end Jameson Graef Rollins
2012-01-23  8:34           ` [PATCH 5/6] emacs: use pop-at-end functionality in show-archive-message-then-next function Jameson Graef Rollins
2012-01-23  8:34             ` [PATCH 6/6] emacs: modify the default show-mode key bindings for archiving Jameson Graef Rollins
2012-01-23 11:14               ` David Edmondson
2012-01-23 21:03               ` Xavier Maillard
2012-01-24 18:50               ` Tomi Ollila
2012-01-23 11:02           ` [PATCH 4/6] emacs: add option to notmuch-show-next-open-message to pop out to parent buffer if at end David Edmondson
2012-01-23 17:39             ` Jameson Graef Rollins
2012-01-23 17:55               ` David Edmondson
2012-01-23 18:51                 ` Jameson Graef Rollins
2012-01-23 11:01         ` [PATCH 3/6] emacs: add message archiving functions David Edmondson
2012-01-24 18:44         ` Tomi Ollila
2012-01-23 11:01       ` [PATCH 2/6] emacs: break out thread navigation from notmuch-show-archive-thread David Edmondson
2012-01-23 11:00     ` [PATCH 1/6] emacs: break up notmuch-show-archive-thread-internal into two more generally useful functions David Edmondson
2012-01-25  0:06   ` Jameson Graef Rollins
2012-01-25  0:06     ` [PATCH v3 1/8] emacs: use search-next-thread to move to next thread in show mode Jameson Graef Rollins
2012-01-25  0:06       ` [PATCH v3 2/8] emacs: break up notmuch-show-archive-thread-internal into two more generally useful functions Jameson Graef Rollins
2012-01-25  0:06         ` Jameson Graef Rollins [this message]
2012-01-25  0:06           ` [PATCH v3 4/8] emacs: add message archiving functions Jameson Graef Rollins
2012-01-25  0:06             ` [PATCH v3 5/8] emacs: add option to show-next-{, open-}message functions to pop out to parent buffer if at end Jameson Graef Rollins
2012-01-25  0:06               ` [PATCH v3 6/8] emacs: use pop-at-end functionality in show-archive-message-then-next function Jameson Graef Rollins
2012-01-25  0:06                 ` [PATCH v3 7/8] emacs: modify the default show-mode key bindings for archiving Jameson Graef Rollins
2012-01-25  0:06                   ` [PATCH v3 8/8] emacs: fix show-previous-message doc string Jameson Graef Rollins
2012-01-25 10:53                     ` David Edmondson
2012-01-25 10:53                   ` [PATCH v3 7/8] emacs: modify the default show-mode key bindings for archiving David Edmondson
2012-01-25 10:52                 ` [PATCH v3 6/8] emacs: use pop-at-end functionality in show-archive-message-then-next function David Edmondson
2012-01-25 10:51               ` [PATCH v3 5/8] emacs: add option to show-next-{, open-}message functions to pop out to parent buffer if at end David Edmondson
2012-01-25 10:50             ` [PATCH v3 4/8] emacs: add message archiving functions David Edmondson
2012-01-25 10:49           ` [PATCH v3 3/8] emacs: break out thread navigation from notmuch-show-archive-thread David Edmondson
2012-01-25 10:47         ` [PATCH v3 2/8] emacs: break up notmuch-show-archive-thread-internal into two more generally useful functions David Edmondson
2012-01-25 10:53       ` [PATCH v3 1/8] emacs: use search-next-thread to move to next thread in show mode David Edmondson
2012-01-31  3:28     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327449983-23638-4-git-send-email-jrollins@finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).