From 3c13316b78970ce38ad162e07eb21e7fd8d7cbb5 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 14 Feb 2019 21:42:20 -0500 Subject: [PATCH] Add nm-sticky-tag-and-next function to set a tag, then tag things with it --- .emacs.d/init.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 02f91ed..9a00e56 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -746,7 +746,8 @@ ("s" . nm-spam) ("G" . nm-update-remote) ("j" . next-line) - ("k" . previous-line)) + ("k" . previous-line) + ("N" . nm-sticky-tag-and-next)) :config (defun nm-tag-and-next (tags) "Apply some changes to a message, then move to the next line" @@ -766,6 +767,16 @@ (interactive) (shell-command "muchsync ag") (nm-refresh)) + (defvar nm-sticky-tags nil) + (defun nm-sticky-tag-and-next (tags) + (interactive + (if (or current-prefix-arg (null nm-sticky-tags)) + (list (notmuch-tag-change-list (split-string + (read-string + "tags: " (mapconcat 'identity nm-sticky-tags " "))))) + (list nm-sticky-tags))) + (setq nm-sticky-tags tags) + (nm-tag-and-next tags)) (setq message-kill-buffer-on-exit t mail-host-address "adamgoldsmith.name"