Re: get subject and from on wl-biff-notify-hook function

Kazuhiro Ito <[email protected]> Thu, 01 Aug 2019 00:11:01 +0900
Newsgroups gmane.mail.wanderlust.general.japanese
Message-ID <[email protected]>
> Kazuhiro> Probably reading elmo-folder-synchronize in elmo.el may help
> Kazuhiro> you.  It checks whether there are new messages in a server
> Kazuhiro> and add entries of new messages into msgdb.
> 
> On my case mbsync download my messages to a local
> Maildir. elmo-folder-synchronize still applies or there is a way of
> getting the new messages from msgdb.

I have not used Maildir, but elmo-folder-synchronize should also
work.  For example, the below code gets a list of new messages's
subject of "+spam" folder.

(let* ((folder "+spam")
       (elmo-folder (wl-folder-get-elmo-folder folder))
       (unread (cadr (elmo-list-diff
		      (elmo-folder-list-messages elmo-folder t t)
		      ;; Probably files in "new" directory are moved
		      ;; into "cur" directory
		      (elmo-folder-list-messages elmo-folder t nil))))
       (msgdb (elmo-folder-msgdb-create elmo-folder unread nil))
       result)
  (elmo-folder-msgdb-create elmo-folder unread nil)
  (dolist (number (elmo-msgdb-list-messages msgdb))
    (setq result (cons (elmo-msgdb-overview-entity-get-subject
			(elmo-msgdb-message-entity msgdb number))
		       result)))
  result)

-- 
Kazuhiro Ito