aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--oni-notmuch.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/oni-notmuch.el b/oni-notmuch.el
index 110afac..a930469 100644
--- a/oni-notmuch.el
+++ b/oni-notmuch.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2023.0621.223804
+;; Version: 2023.0622.163614
;; Package-Requires: (oni-sendmail notmuch ol-notmuch)
;; This program is free software; you can redistribute it and/or modify
@@ -38,11 +38,23 @@ in which to mark thread."
(notmuch-search-archive-thread reverse begin end)
(notmuch-search-tag (notmuch-tag-change-list '("deleted") reverse) begin end))
+(defun oni-notmuch-hello-insert-notmuch-command ()
+ "Insert a button to run the notmuch command to synchronize mail."
+ (widget-insert "Sync email: ")
+ (widget-create 'push-button
+ :notify (lambda (&rest _)
+ (async-shell-command "notmuch new"))
+ "sync")
+ (widget-insert "\n"))
+
(add-to-list 'notmuch-search-line-faces
'("@me" . (:foreground "#90ca82")))
(add-to-list 'notmuch-search-line-faces
'("deleted" . (:foreground "#3f4242")))
+(setf (cdr notmuch-hello-sections)
+ (cons 'oni-notmuch-hello-insert-notmuch-command (cdr notmuch-hello-sections)))
+
(define-key notmuch-search-mode-map (kbd "d") #'oni-notmuch-search-delete-thread)
(provide 'oni-notmuch)