X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=emacstips.mdwn;h=e73c1f5538a46791d3508f571a9147ecc2e257a9;hb=a0082ab909e7fe706384842859169153e8fa12da;hp=ef96e00210a201767b12bb162a4235bef2f8c9f2;hpb=b02f174fe4dfc0bf7e0cb73bcf53354d9c4d38de;p=notmuch-wiki diff --git a/emacstips.mdwn b/emacstips.mdwn index ef96e00..e73c1f5 100644 --- a/emacstips.mdwn +++ b/emacstips.mdwn @@ -197,6 +197,34 @@ And version for notmuch 0.12 (not released yet) (if (member "deleted" (notmuch-show-get-tags)) "-deleted" "+deleted")))) +## Adding many tagging keybindings + +If you want to have have many tagging keybindings, you can save the typing +the few lines of boilerplate for every binding (for versions before 0.12, +you will need to change notmuch-show-apply-tag-macro). + + (eval-after-load 'notmuch-show + '(define-key notmuch-show-mode-map "`" 'notmuch-show-apply-tag-macro)) + + (setq notmuch-show-tag-macro-alist + (list + '("m" "+notmuch::patch" "+notmuch::moreinfo" "-notmuch::needs-review") + '("n" "+notmuch::patch" "+notmuch::needs-review" "-notmuch::pushed") + '("o" "+notmuch::patch" "+notmuch::obsolete" + "-notmuch::needs-review" "-notmuch::moreinfo") + '("p" "-notmuch::pushed" "-notmuch::needs-review" + "-notmuch::moreinfo" "+pending") + '("P" "-pending" "-notmuch::needs-review" "-notmuch::moreinfo" "+notmuch::pushed") + '("r" "-notmuch::patch" "+notmuch::review") + '("s" "+notmuch::patch" "-notmuch::obsolete" "-notmuch::needs-review" "-notmuch::moreinfo" "+notmuch::stale") + '("t" "+notmuch::patch" "-notmuch::needs-review" "+notmuch::trivial") + '("w" "+notmuch::patch" "+notmuch::wip" "-notmuch::needs-review"))) + + (defun notmuch-show-apply-tag-macro (key) + (interactive "k") + (let ((macro (assoc key notmuch-show-tag-macro-alist))) + (apply 'notmuch-show-tag-message (cdr macro)))) + ## Restore reply-to-all key binding to 'r' Starting from notmuch 0.12 the 'r' key is bound to reply-to-sender instead of