Skip to content

Instantly share code, notes, and snippets.

@cofi
Last active January 2, 2016 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cofi/8341559 to your computer and use it in GitHub Desktop.
Save cofi/8341559 to your computer and use it in GitHub Desktop.
(defmacro my-notmuch-search-creator (name &rest tags)
(let ((funname (intern (concat "my-notmuch-search-for-" (symbol-name name)))))
`(progn
(defun ,funname ()
(interactive)
(notmuch-search-tag (my-notmuch-toggle-tags-changes
(notmuch-search-get-tags)
tags)))
',funname)))
(evil-define-key 'motion notmuch-search-mode-map
"d" (my-notmuch-search-creator deleted "deleted")
"a" (my-notmuch-search-creator new-arrivals "inbox")
"m" (my-notmuch-search-creator muted "muted")
"s" (my-notmuch-search-creator unread "unread")
"S" (my-notmuch-search-creator there-it-goes "learn" "spam")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment