[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (auto-)refile questions



David Maus wrote:
> 
> Morgan Veyret wrote:
> >Hello,
> >I just started using Wanderlust and I'm trying to use auto-refile.
> >I currently have two problems:
> 
> >1/ After I refile some messages from my inbox to another folder, the folder view count them as
> >unread and I have to visit every affected folder to fix the summary counts (messages are not marked
> >as unread in summary view). How can I change this?
> 
> Could you tell what folder types are you using?  I noticed that
> neither unread nor new message count is updated if I refile a message
> from IMAP to IMAP but both, unread and new message count is updated
> when I refile IMAP to local maildir.

We need a new tagline: "There's a hack for that." This one uses
advice, so it's a REAL hack...

  ;; Sync folders affected by refile/copy after exec

  (defun wl-get-target-folders (mark-list)
    (let* ((all-folders (mapcar 'caddr mark-list))
           (folders (elmo-uniq-list all-folders)))
      folders))

  (defun wl-sync-after-exec (folders)
    (let ((msg (message-displayed-p t)))
      (mapcar 'wl-folder-sync-entity folders)
      (message msg)))

  (defadvice wl-summary-exec-action-refile
    (around wl-summary-sync-after-refile activate)
    (let ((folders (wl-get-target-folders (ad-get-arg 0))))
      ad-do-it
      (wl-sync-after-exec folders)))

  (defadvice wl-summary-exec-action-copy
    (around wl-summary-sync-after-copy activate)
    (let ((folders (wl-get-target-folders (ad-get-arg 0))))
      ad-do-it
      (wl-sync-after-exec folders)))

--
Ron Isaacson
Morgan Stanley
ron.isaacson@morganstanley.com / (212) 276-1349