diff options
author | jao <jao@gnu.org> | 2022-02-28 22:31:20 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-02-28 22:31:20 +0000 |
commit | cbc69d579b703f7eb0eb3029ef7fb73801a7d81d (patch) | |
tree | 17a9c6aec16d1cdb3f48440ca3368d4d756d4512 | |
parent | 7c0ae514b67723fa62229e1778e727833228f016 (diff) | |
download | elibs-cbc69d579b703f7eb0eb3029ef7fb73801a7d81d.tar.gz elibs-cbc69d579b703f7eb0eb3029ef7fb73801a7d81d.tar.bz2 |
gnus demon simplifications
-rw-r--r-- | gnus.org | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -293,10 +293,6 @@ #+begin_src emacs-lisp (setq mail-user-agent 'gnus-user-agent) - (require 'gnus-demon) - (gnus-demon-add-handler 'gnus-demon-scan-news 5 1) - ;; (gnus-demon-remove-handler 'gnus-demon-scan-news) - ;; synchronicity (setq gnus-asynchronous t) ;;; prefetch as many articles as possible @@ -346,22 +342,24 @@ jao-gnus-tracked-groups)))) (defun jao-gnus--notify () - (let ((inhibit-message t)) - (shell-command-to-string "index-mail.sh") - (setq jao-gnus--notify-strs (jao-gnus--notify-strs)) - (save-window-excursion (jao-minibuffer-refresh)))) + (setq jao-gnus--notify-strs (jao-gnus--notify-strs)) + (save-window-excursion (jao-minibuffer-refresh))) - (add-hook 'gnus-after-getting-new-news-hook #'jao-gnus--notify) - (add-hook 'gnus-started-hook #'jao-gnus--notify) + (defun jao-gnus-scan () + (interactive) + (let ((inhibit-message t)) + (gnus-demon-scan-mail) + (shell-command "index-mail.sh") + (save-window-excursion ) + (jao-gnus--notify))) - (defun jao-gnus--summary-done () - (let ((inhibit-message t) - (message-log-max nil)) - (save-window-excursion - (jao-gnus--notify) - (org-agenda-list)))) + (require 'gnus-demon) + (gnus-demon-add-handler 'jao-gnus-scan 5 5) + ;; (gnus-demon-remove-handler 'jao-gnus-scan) - (add-hook 'gnus-summary-exit-hook #'jao-gnus--summary-done) + (add-hook 'gnus-started-hook #'jao-gnus-scan) + (add-hook 'gnus-summary-exit-hook #'jao-gnus--notify) + (add-hook 'gnus-summary-exit-hook #'org-agenda-list) (with-eval-after-load "jao-minibuffer" (jao-minibuffer-add-variable 'jao-gnus--notify-strs -20)) |