diff --git a/emacs/module/module-notmuch.el b/emacs/module/module-notmuch.el index f559092..861cef4 100644 --- a/emacs/module/module-notmuch.el +++ b/emacs/module/module-notmuch.el @@ -17,6 +17,17 @@ user-mail-address "me@lkn.uber.space" user-full-name "Levi Neely") +(defun sync-and-index-mail () + "Synchronize mail using mbsync and index with notmuch." + (interactive) + (let ((default-directory "~/")) + (message "Syncing mail...") + (shell-command "mbsync uberspace >/dev/null") + (message "Indexing mail...") + (shell-command "notmuch new >/dev/null") + (message "Mail sync and indexing completed."))) + +(global-set-key (kbd "C-x M") 'sync-and-index-mail) (provide 'module-notmuch) ;;; module-qt.el ends here.