* wl-summary.el (wl-summary-buffer-event-handler): New internal
variable.
(wl-summary-event-handler): New class.
(elmo-event-handler-flag-changed): Define to update persistent
mark.
(wl-summary-buffer-set-folder): Register event handler to
elmo-folder.
(wl-summary-exit): Unregister event handler.
(wl-summary-goto-folder-subr): Ditto.
(wl-summary-mark-as-read-all): Does not call
`wl-summary-update-persistent-mark' directly.
(wl-summary-mark-as-read-internal): Ditto.
(wl-summary-set-persistent-mark-internal): Ditto.
(wl-summary-set-flags-internal): Ditto.
* elmo.el (elmo-folder): Added handlers slot.
(elmo-event-handler): New class.
(elmo-event-handler-flag-changed): New API.
(elmo-folder-add-handler): New function.
(elmo-folder-remove-handler): Ditto.
(elmo-folder-notify-event): Ditto.
(elmo-folder-set-flag): Call `elmo-folder-notify-event' with event
`flag-changed'.
(elmo-folder-unset-flag): Ditto.
* elmo-pipe.el (elmo-folder-set-flag): Ditto.
(elmo-folder-unset-flag): Ditto.
* elmo-multi.el (elmo-folder-set-flag): Ditto.
(elmo-folder-unset-flag): Ditto.
* elmo-filter.el (elmo-folder-set-flag): Ditto.
(elmo-folder-unset-flag): Ditto.