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 D4AB1431FBC for ; Wed, 17 Feb 2010 04:12:47 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.15 X-Spam-Level: X-Spam-Status: No, score=-1.15 tagged_above=-999 required=5 tests=[AWL=-0.040, BAYES_05=-1.11] autolearn=ham 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 rQFjKW8JqfoB for ; Wed, 17 Feb 2010 04:12:47 -0800 (PST) Received: from homiemail-a15.g.dreamhost.com (caiajhbdccah.dreamhost.com [208.97.132.207]) by olra.theworths.org (Postfix) with ESMTP id E9F86431FAE for ; Wed, 17 Feb 2010 04:12:46 -0800 (PST) Received: from localhost.localdomain (mtec-hg-docking-1-dhcp-204.ethz.ch [129.132.133.204]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPA id A9BA476C06B; Wed, 17 Feb 2010 04:12:45 -0800 (PST) From: Sebastian Spaeth To: notmuch@notmuchmail.org Date: Wed, 17 Feb 2010 13:12:26 +0100 Message-Id: <1266408746-28549-1-git-send-email-Sebastian@SSpaeth.de> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <87sk90ragj.fsf@jhu.edu> References: <87sk90ragj.fsf@jhu.edu> Subject: [notmuch] [PATCH] notmuch.el: bind 'd' to new function notmuch-search-delete-thread-or-region 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: Wed, 17 Feb 2010 12:12:48 -0000 Create a new function notmuch-search-delete-thread-or region which does exactly what its name implies. Hitting 'd' will delete the current thread (or multiple threads if you marked a region). Deleting means adding tag 'delete' and removing tags 'unread' and 'inbox' in this case. This patch requires Jesse's patch from mail id:87sk90ragj.fsf@jhu.edu. Signed-off-by: Sebastian Spaeth --- notmuch.el | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/notmuch.el b/notmuch.el index 7d9a82f..ac07ff3 100644 --- a/notmuch.el +++ b/notmuch.el @@ -1101,6 +1101,7 @@ matching this search term are shown if non-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-or-region) (define-key map "-" 'notmuch-search-remove-tag) (define-key map "+" 'notmuch-search-add-tag) (define-key map (kbd "RET") 'notmuch-search-show-thread) @@ -1396,6 +1397,16 @@ This function advances the next thread when finished." (notmuch-search-remove-tag-thread "inbox") (forward-line)) +(defun notmuch-search-delete-thread-or-region () + "Delete the currently selected thread (tag \"+delete -inbox -unread\"). + +This function advances the next thread when finished." + (interactive) + (notmuch-search-add-tag "delete") + (notmuch-search-remove-tag "inbox") + (notmuch-search-remove-tag "unread") + (forward-line)) + (defun notmuch-search-process-sentinel (proc msg) "Add a message to let user know when \"notmuch search\" exits" (let ((buffer (process-buffer proc)) -- 1.6.3.3