From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id F2B4A40EF50 for ; Sat, 7 Jan 2012 14:28:26 -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 d2ZcLm6YfchD for ; Sat, 7 Jan 2012 14:28:26 -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 C6BDB40F1AB for ; Sat, 7 Jan 2012 14:28:23 -0800 (PST) Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) by earth-doxen-postvirus (Postfix) with ESMTP id 5C6D266E00D8 for ; Sat, 7 Jan 2012 14:28:23 -0800 (PST) X-Spam-Scanned: at Caltech-IMSS on earth-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 earth-doxen-submit (Postfix) with ESMTP id 5F84E66E00BD for ; Sat, 7 Jan 2012 14:28:21 -0800 (PST) Received: by finestructure.net (Postfix, from userid 1000) id D54E71165; Sat, 7 Jan 2012 14:28:20 -0800 (PST) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 3/4] emacs: add ability to "delete" messages and threads Date: Sat, 7 Jan 2012 14:28:13 -0800 Message-Id: <1325975294-646-4-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1325975294-646-3-git-send-email-jrollins@finestructure.net> References: <1325975294-646-1-git-send-email-jrollins@finestructure.net> <1325975294-646-2-git-send-email-jrollins@finestructure.net> <1325975294-646-3-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: Sat, 07 Jan 2012 22:28:27 -0000 This completely mimics the behavior of archiving, but instead of remove the inbox tag it add the "deleted" tag. The functionality is bound to the 'd' key in both search and show mode. Note: this does *not* actually delete any messages. That is still left entirely up to the user to figure out how they want to handle that. This *just* adds the "deleted" tag to messages, no more. If the notmuch-search-exclude-deleted config variable is set, though, "deleted" messages will be excluded from search results. --- emacs/notmuch-show.el | 15 +++++++++++++++ emacs/notmuch.el | 12 ++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 1e16f05..e1d15f4 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -944,6 +944,7 @@ thread id. If a prefix is given, crypto processing is toggled." (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 "d" 'notmuch-show-delete-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) @@ -1454,6 +1455,20 @@ buffer." (interactive) (notmuch-show-tag-thread-internal "-" "inbox" nil)) +(defun notmuch-show-delete-thread () + "Delete each message in thread, then show next thread from search. + +Delete each message currently shown by adding the \"deleted\" +tag to each. Then kill this buffer and show the next thread +from the search from which this thread was originally shown. + +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) + (notmuch-show-tag-thread-internal "+" "deleted" t)) + (defun notmuch-show-stash-cc () "Copy CC field of current message to kill-ring." (interactive) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index c519687..2b860f4 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -218,6 +218,7 @@ For a mouse binding, return nil." (define-key map [mouse-1] 'notmuch-search-show-thread) (define-key map "*" 'notmuch-search-operate-all) (define-key map "a" 'notmuch-search-archive-thread) + (define-key map "d" 'notmuch-search-delete-thread) (define-key map "-" 'notmuch-search-remove-tag) (define-key map "+" 'notmuch-search-add-tag) (define-key map (kbd "RET") 'notmuch-search-show-thread) @@ -605,6 +606,17 @@ This function advances the next thread when finished." (notmuch-search-remove-tag-thread "inbox") (forward-line)) +(defun notmuch-search-delete-thread () + "Delete the currently selected thread (add the \"deleted\" tag). + +This function advances the next thread when finished. + +If notmuch-search-exclude-deleted is set, \"deleted\" messages +will be excluded from searches." + (interactive) + (notmuch-search-add-tag "deleted") + (forward-line)) + (defvar notmuch-search-process-filter-data nil "Data that has not yet been processed.") (make-variable-buffer-local 'notmuch-search-process-filter-data) -- 1.7.7.3