* elmo.el (elmo-init): Run the elmo-init-hook.
* elmo-flag.el (elmo-global-mark-migrate): New function.
+2003-11-06 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-vars.el (elmo-init-hook): New user option.
+
+ * elmo.el (elmo-init): Run the elmo-init-hook.
+
+ * elmo-flag.el (elmo-global-mark-migrate): New function.
+
2003-11-06 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
* modb-standard.el (elmo-msgdb-set-flag): Simplify;
(defvar elmo-global-mark-filename "global-mark"
"Obsolete variable. (Just for migration)")
+(defun elmo-global-mark-migrate ()
+ "Migrate from 'mark to 'flag. For automatic migration."
+ (elmo-global-flag-initialize)
+ (when (and (file-exists-p (expand-file-name elmo-global-mark-filename
+ elmo-msgdb-directory))
+ (elmo-global-flag-p 'important)
+ (not (file-exists-p (elmo-folder-expand-msgdb-path
+ (elmo-flag-get-folder 'important)))))
+ (elmo-global-mark-upgrade)))
+
(defun elmo-global-mark-upgrade ()
"Upgrade old `global-mark' structure."
(interactive)
:group 'elmo
:group 'elmo-setting)
+(defcustom elmo-init-hook '(elmo-global-mark-migrate)
+ "*A hook called when elmo is initialized."
+ :type 'hook
+ :group 'elmo)
+
(defvar elmo-msgdb-file-header-chop-length 2048
"*Number of bytes to get header in one reading from file.")
(elmo-crosspost-message-alist-load)
(elmo-resque-obsolete-variables)
(elmo-global-flag-initialize)
- (elmo-dop-queue-load))
+ (elmo-dop-queue-load)
+ (run-hooks 'elmo-init-hook))
(defun elmo-quit ()
"Quit and cleanup ELMO."