[notmuch] [PATCH] notmuch.el: bind 'd' to new function notmuch-search-delete-thread-or-region

Sebastian Spaeth Sebastian at SSpaeth.de
Wed Feb 17 04:12:26 PST 2010


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 at jhu.edu.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
---
 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



More information about the notmuch mailing list