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 E26B741ED84 for ; Tue, 17 Jan 2012 10:05:47 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 4-PcddZ8XMGS for ; Tue, 17 Jan 2012 10:05:46 -0800 (PST) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 0DED641ED8D for ; Tue, 17 Jan 2012 10:05:39 -0800 (PST) Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) by fire-doxen-postvirus (Postfix) with ESMTP id B1E332E502F2 for ; Tue, 17 Jan 2012 10:05:38 -0800 (PST) X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new Received: from finestructure.net (cpe-76-174-137-84.socal.res.rr.com [76.174.137.84]) (Authenticated sender: jrollins) by fire-doxen-submit (Postfix) with ESMTP id 52EE92E50E0B for ; Tue, 17 Jan 2012 10:05:32 -0800 (PST) Received: by finestructure.net (Postfix, from userid 1000) id E317152B; Tue, 17 Jan 2012 10:05:31 -0800 (PST) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 2/6] emacs: break out thread navigation from notmuch-show-archive-thread Date: Tue, 17 Jan 2012 10:05:27 -0800 Message-Id: <1326823531-14549-2-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1326823531-14549-1-git-send-email-jrollins@finestructure.net> References: <871uqy19yo.fsf@servo.finestructure.net> <1326823531-14549-1-git-send-email-jrollins@finestructure.net> 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: Tue, 17 Jan 2012 18:05:48 -0000 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 3625afd..ee9ef62 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -945,7 +945,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) @@ -1200,7 +1200,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]). @@ -1453,8 +1453,12 @@ argument, hide all of the messages." (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 @@ -1465,13 +1469,20 @@ being delivered to the same thread. It does not archive the entire thread, but only the messages shown in the current buffer." (interactive) - (notmuch-show-remove-tag-thread "inbox") + (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-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.7.3