From 3cf1da4c748fafcdd7757e6781aeef6d1e7f81ec Mon Sep 17 00:00:00 2001 From: teranisi Date: Thu, 6 Nov 2003 14:15:47 +0000 Subject: [PATCH] * 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. --- elmo/ChangeLog | 8 ++++++++ elmo/elmo-flag.el | 10 ++++++++++ elmo/elmo-vars.el | 5 +++++ elmo/elmo.el | 3 ++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 42aeb1c..e8f8754 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,11 @@ +2003-11-06 Yuuichi Teranishi + + * 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 * modb-standard.el (elmo-msgdb-set-flag): Simplify; diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index e3c3649..c1bb436 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -372,6 +372,16 @@ the message is not flagged in any folder." (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) diff --git a/elmo/elmo-vars.el b/elmo/elmo-vars.el index 3d98591..c405355 100644 --- a/elmo/elmo-vars.el +++ b/elmo/elmo-vars.el @@ -75,6 +75,11 @@ :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.") diff --git a/elmo/elmo.el b/elmo/elmo.el index c76fdd5..70d1cc9 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1597,7 +1597,8 @@ Return a hashtable for newsgroups." (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." -- 1.7.10.4