archive yearwk if required
authorJames Richardson <james@jamestechnotes.com>
Mon, 27 Nov 2017 22:59:26 +0000 (17:59 -0500)
committerJames Richardson <james@jamestechnotes.com>
Mon, 27 Nov 2017 22:59:26 +0000 (17:59 -0500)
.emacs.d/config/mu4e.el

index c131ee372eb5d04d9de6c89c6f0b6bd0205c3b9c..a9770f1649f14808650340bb5a3e208ed30c2861 100644 (file)
        (let ((archive)
              (case-fold-search t)
              (maildir (mu4e-message-field msg :maildir))
-             (year (format-time-string "%Y%U" (mu4e-message-field msg :date))))
+             (year (format-time-string "%Y%U" (mu4e-message-field msg :date)))
+             (yearweek (format-time-string "%Y%U" (mu4e-message-field msg :date))))
          (cond
           ;; don't refile trash
           ((string-match-p "trash" maildir) maildir)
           ;; if /jrichar-lowes refile to /lowes-archive/YYYY
-          ((string-match-p "^/acct-1" maildir) (concat "/archives/spec01/mail." year)) ;; merged acct-1 and acct-8
-          ((string-match-p "^/acct-8" maildir) (concat "/archives/spec01/mail." year))
+          ((string-match-p "^/acct-1" maildir) (concat "/archives/spec01/mail." yearweek)) ;; merged acct-1 and acct-8
+          ((string-match-p "^/acct-8" maildir) (concat "/archives/spec01/mail." yearweek))
           ((string-match-p "^/acct-[2-7]" maildir) (concat "/archives/mail." year))
           ;; / is local
           ((string-match-p "^/$" maildir) (concat "/archives/mail." year))