diff options
author | jao <jao@gnu.org> | 2020-12-04 11:15:23 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-12-04 11:15:23 +0000 |
commit | acf3bd89f060c9246587cd20bec6b401ed677d5c (patch) | |
tree | b1058d5579617fd259e2418f2d46ec6c25a6f45b | |
parent | 6c7d55707e3432d6c76480fff248cfea804cafd5 (diff) | |
download | elibs-acf3bd89f060c9246587cd20bec6b401ed677d5c.tar.gz elibs-acf3bd89f060c9246587cd20bec6b401ed677d5c.tar.bz2 |
jao-maildir clean-ups
-rw-r--r-- | net/jao-maildir.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/jao-maildir.el b/net/jao-maildir.el index 2e15980..05cfc2d 100644 --- a/net/jao-maildir.el +++ b/net/jao-maildir.el @@ -77,8 +77,7 @@ (dolist (mbox maildirs) (let ((lb (seq-find (lambda (lb) (string-match-p lb mbox)) (hash-table-keys label-mboxes)))) - (puthash lb (cons mbox (gethash lb label-mboxes)) label-mboxes) - (puthash mbox lb mboxes-label))) + (puthash lb (cons mbox (gethash lb label-mboxes)) label-mboxes))) (setq jao-maildir--label-mboxes label-mboxes) (setq jao-maildir--trackers trackers))) @@ -103,10 +102,13 @@ (cons str other)))) (setq jao-maildir--track-strings other))))) -(defun jao-maildir--update-info-string (&optional mbox) +;;;###autoload +(defun jao-maildir-update-info-string (&optional mbox) (cond ((eq mbox t) (seq-do 'jao-maildir--update-track-string jao-maildir--maildirs)) - ((stringp mbox) (jao-maildir--update-track-string mbox))) + ((stringp mbox) + (puthash mbox (jao-maildir--maildir-new-count mbox) jao-maildir--counts) + (jao-maildir--update-track-string mbox))) (let ((s (mapconcat 'identity (mapcar 'cdr jao-maildir--track-strings) " "))) (setq jao-maildir-info-string (if (string-blank-p s) "" (concat s " ")))) (when jao-maildir-echo-p (jao-minibuffer-refresh))) @@ -125,8 +127,7 @@ (lambda (e) (jao-maildir--log-watch e mbox) (when (memq (cadr e) '(created deleted)) - (puthash mbox (jao-maildir--maildir-new-count mbox) jao-maildir--counts) - (jao-maildir--update-info-string mbox) + (jao-maildir-update-info-string mbox) (when cb (funcall cb mbox))))) (defun jao-maildir--setup-watches (cb) @@ -145,7 +146,7 @@ (add-to-list 'global-mode-string 'jao-maildir-info-string t)) ((eq 'minibuffer mode-line) (jao-minibuffer-add-variable 'jao-maildir-info-string) - (jao-maildir--update-info-string t)) + (jao-maildir-update-info-string t)) (t (error "Invalid mode-line value"))) (jao-maildir--setup-watches cb)) |