From 9719dd00def49928a2632c99ec3d05178f4a1926 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 20 Nov 2018 11:58:45 -0500 Subject: [PATCH] Add nm-spam and binding --- .emacs.d/init.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1c42065..0a56f66 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -713,14 +713,22 @@ :quelpa (nm :fetcher github :repo "ad1217/nevermore" :branch "fix-deleted") :bind (:map nm-mode-map ("n" . nm-read) + ("s" . nm-spam) ("G" . nm-update-remote)) :config + (defun nm-tag-and-next (tags) + "Apply some changes to a message, then move to the next line" + (nm-apply-to-result (lambda (q) (notmuch-tag q tags))) + (nm-update-tags) + (forward-line)) (defun nm-read () "Mark message as read." (interactive) - (nm-apply-to-result (lambda (q) (notmuch-tag q '("-unread")))) - (nm-update-tags) - (forward-line)) + (nm-tag-and-next '("-unread"))) + (defun nm-spam () + "Mark message as read." + (interactive) + (nm-tag-and-next '("+spam" "-unread" "-inbox"))) (defun nm-update-remote () "Pull email from remote mailbox" (interactive)