(require 'wl)
(require 'elmo-nntp))
+(defcustom wl-folder-init-hook nil
+ "A hook called after folder initialization is finished."
+ :type 'hook
+ :group 'wl)
+
(defvar wl-folder-buffer-name "Folder")
(defvar wl-folder-entity nil) ; desktop entity.
(defvar wl-folder-group-alist nil) ; opened or closed
(wl-folder-sync-entity entity)
(setq nums (elmo-folder-diff folder)))
(unless wl-folder-notify-deleted
- (setq unsync (if (and (car nums) (> 0 (car nums))) 0 (car nums)))
- (setq nomif (if (and (car nums) (> 0 (cdr nums))) 0 (cdr nums)))
+ (setq unsync (if (car nums)
+ (max 0 (car nums))
+ nil))
+ (setq nomif (if (cdr nums)
+ (max 0 (cdr nums))
+ nil))
(setq nums (cons unsync nomif)))
(setq unread (or ;; If server diff, All unreads are
; treated as unsync.
(wl-summary-count-unread (elmo-msgdb-mark-load
(elmo-folder-msgdb-path
folder)))))
- (setq unread (min unread (- (or (cdr nums) 0) (or (car nums) 0))))
(when new (setq unread (- unread new)))
(wl-folder-entity-hashtb-set wl-folder-entity-hashtb entity
(list (or new (car nums))
(setq wl-folder-info-alist-modified t)
(sit-for 0)
(list (if wl-folder-notify-deleted
- (car nums)
- (or new (max (or (car nums) 0)))) unread (cdr nums))))
+ (or new (car nums) 0)
+ (max 0 (or new (car nums) 0)))
+ unread
+ (cdr nums))))
(defun wl-folder-check-entity-async (entity &optional auto)
(let ((elmo-nntp-groups-async t)
(interactive)
(if wl-use-acap
(wl-acap-init)
- (funcall wl-folder-init-function)))
+ (funcall wl-folder-init-function))
+ (run-hooks 'wl-folder-init-hook))
(defun wl-local-folder-init ()
"Initialize local folder."