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 1B025431FD0 for ; Sat, 16 Jul 2011 11:40:29 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 xkap4AnwjqI9 for ; Sat, 16 Jul 2011 11:40:27 -0700 (PDT) Received: from marcos.anarcat.ath.cx (H144.C72.B0.tor.eicat.ca [72.0.72.144]) by olra.theworths.org (Postfix) with ESMTP id 28DA5431FB6 for ; Sat, 16 Jul 2011 11:40:27 -0700 (PDT) Received: by marcos.anarcat.ath.cx (Postfix, from userid 1000) id 73C817621D; Sat, 16 Jul 2011 14:40:26 -0400 (EDT) From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= To: notmuch@notmuchmail.org Subject: [PATCH 1/2] add notmuch keybinding 'd' Date: Sat, 16 Jul 2011 14:39:59 -0400 Message-Id: <1310841600-28281-1-git-send-email-anarcat@koumbit.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1266408746-28549-1-git-send-email-Sebastian@SSpaeth.de> References: <1266408746-28549-1-git-send-email-Sebastian@SSpaeth.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= 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, 16 Jul 2011 18:40:29 -0000 It adds a tag 'deleted' and removes the tags 'inbox' and 'unread'. It works in show as well as in search mode Based on previous work by: Sebastian Spaeth Signed-off-by: Antoine Beaupré --- emacs/notmuch-show.el | 8 ++++++++ emacs/notmuch.el | 11 +++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index f96743b..c83b992 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -875,6 +875,7 @@ function is used. " (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) (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) @@ -1297,6 +1298,13 @@ the result." (mapcar (lambda (s) (concat "-" s)) toremove)) (notmuch-show-set-tags new-tags)))) +(defun notmuch-show-delete () + "Delete current mail (tag +deleted -unread -inbox)." + (interactive) + (notmuch-show-add-tag "deleted") + (notmuch-show-remove-tag "unread") + (notmuch-show-remove-tag "inbox")) + (defun notmuch-show-toggle-headers () "Toggle the visibility of the current message headers." (interactive) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index f11ec24..f6fb07b 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -215,6 +215,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-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) @@ -611,6 +612,16 @@ This function advances the next thread when finished." "Data that has not yet been processed.") (make-variable-buffer-local 'notmuch-search-process-filter-data) +(defun notmuch-search-delete-thread-or-region () + "Delete the currently selected thread (tag \"+deleted -inbox -unread\"). + +This function advances the next thread when finished." + (interactive) + (notmuch-search-add-tag "deleted") + (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.7.5.4