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 759BA429E5B for ; Tue, 28 Jun 2011 00:31:44 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 WvfOeTA1LZ6J for ; Tue, 28 Jun 2011 00:31:44 -0700 (PDT) Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E8C90429E4E for ; Tue, 28 Jun 2011 00:31:43 -0700 (PDT) Received: by qwb7 with SMTP id 7so3266915qwb.26 for ; Tue, 28 Jun 2011 00:31:43 -0700 (PDT) Received: by 10.224.200.194 with SMTP id ex2mr5142425qab.202.1309246303242; Tue, 28 Jun 2011 00:31:43 -0700 (PDT) Received: from localhost (nikula.org [92.243.24.172]) by mx.google.com with ESMTPS id d2sm4629402qcs.33.2011.06.28.00.31.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Jun 2011 00:31:42 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 1/4] emacs: Add functions and bindings to archive and mark thread as read Date: Tue, 28 Jun 2011 07:31:29 +0000 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Mailman-Approved-At: Tue, 28 Jun 2011 10:59:27 -0700 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, 28 Jun 2011 07:31:44 -0000 Add "mark as read" versions of the archive thread functions to archive and and mark each message in thread as read by removing the "inbox" and "unread" tags from the messages. Also add default keybindings A and X for them: shifted a and x also mark as read. --- emacs/notmuch-show.el | 25 ++++++++++++++++++++++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 6685717..dbed0a4 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -886,7 +886,9 @@ function is used. " (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 "X" 'notmuch-show-archive-and-read-thread-then-exit) (define-key map "a" 'notmuch-show-archive-thread) + (define-key map "A" 'notmuch-show-archive-and-read-thread) (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) @@ -1349,10 +1351,12 @@ argument, hide all of the messages." (interactive) (backward-button 1)) -(defun notmuch-show-archive-thread-internal (show-next) +(defun notmuch-show-archive-thread-internal (show-next mark-read) ;; Remove the tag from the current set of messages. (goto-char (point-min)) (loop do (notmuch-show-remove-tag "inbox") + (if mark-read + (notmuch-show-remove-tag "unread")) until (not (notmuch-show-goto-message-next))) ;; Move to the next item in the search results, if any. (let ((parent-buffer notmuch-show-parent-buffer)) @@ -1376,12 +1380,27 @@ 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-archive-thread-internal t)) + (notmuch-show-archive-thread-internal t nil)) + +(defun notmuch-show-archive-and-read-thread () + "Archive and read each message in thread, then show next thread from search. + +Archive and mark as read each message currently shown by removing +the \"inbox\" and \"unread\" tags from each. Then kill this +buffer and show the next thread from the search from which this +thread was originally shown." + (interactive) + (notmuch-show-archive-thread-internal t t)) (defun notmuch-show-archive-thread-then-exit () "Archive each message in thread, then exit back to search results." (interactive) - (notmuch-show-archive-thread-internal nil)) + (notmuch-show-archive-thread-internal nil nil)) + +(defun notmuch-show-archive-and-read-thread-then-exit () + "Archive and read each message in thread, then exit back to search results." + (interactive) + (notmuch-show-archive-thread-internal nil t)) (defun notmuch-show-stash-cc () "Copy CC field of current message to kill-ring." -- 1.7.1