diff --git a/init.el b/init.el index 283c74e..79eaae3 100644 --- a/init.el +++ b/init.el @@ -530,6 +530,13 @@ printed representation (via `princ') set as the new value for the key." (when cfg-dir (setq args (nconc (list "-c" cfg-dir) args))) (apply 'call-process "eww" nil 0 nil args))) +(defun my/eww-poll-variables (&rest vars) + "Poll each variable in VARS, which is a lists of strings or symbols." + (let* ((args (cons "poll" (mapcar #'(lambda (elt) (format "%s" elt)) vars))) + (cfg-dir (my/eww-current-config-dir))) + (when cfg-dir + (setq args (nconc (list "-c" cfg-dir) args))) + (apply 'call-process "eww" nil 0 nil args))) ;; mozc (require 'mozc nil t) @@ -2647,6 +2654,11 @@ The name is compared with the field name using TESTFN (defaults to `equal')." (mu4e-alert-set-default-style 'libnotify)) (mu4e t) (mu4e-context-switch nil "Personal") +;; refresh the eww message count +(defun my/-mu4e-eww-refresh-unread-count () + "Refresh the eww unread message count." + (my/eww-poll-variables "mu4e")) +(add-hook 'mu4e-message-changed-hook #'my/-mu4e-eww-refresh-unread-count) ;; mu4e compose HTML messages (use-package org-mime)