magit-todos: supress the jT unbound warning

This commit is contained in:
condy 2020-06-18 22:16:36 +08:00 committed by Pierre Neidhardt
parent a0de3a9cf3
commit a4e568a821
1 changed files with 7 additions and 0 deletions

View File

@ -39,6 +39,10 @@
(evil-collection-define-key 'normal 'magit-status-mode-map
"gT" (and (bound-and-true-p magit-todos-mode) 'magit-todos-jump-to-todos)))
(defun evil-collection-magit-todos-supress-warning (func &rest args)
"Supress the jT keybinding warning."
(cl-letf* (((symbol-function 'message) #'ignore))
(apply func args)))
;;;###autoload
(defun evil-collection-magit-todos-setup ()
@ -50,6 +54,9 @@
(evil-collection-define-key nil 'magit-todos-item-section-map
"j" nil)
;; No need to tell me that jT isn't bound
(advice-add 'magit-todos-mode :around 'evil-collection-magit-todos-supress-warning)
(add-hook 'magit-todos-mode-hook 'evil-collection-magit-todos-setup-jump-key))