From: bg66 Date: Tue, 5 Dec 2006 01:38:57 +0000 (+0000) Subject: * sb-mixi.el (shimbun-mixi-logout-p): New user option. X-Git-Tag: mixi-el-1_0_0~173 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=482ffdb4aa0a214d929962b40a8d434a04629236;p=elisp%2Fmixi.git * sb-mixi.el (shimbun-mixi-logout-p): New user option. (shimbun-mixi-initialize-comment-cache): New macro. (initialize-instance): Use it. (shimbun-close): New method. --- diff --git a/ChangeLog b/ChangeLog index e4a8126..87ed83c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-12-05 OHASHI Akira + + * sb-mixi.el (shimbun-mixi-logout-p): New user option. + (shimbun-mixi-initialize-comment-cache): New macro. + (initialize-instance): Use it. + (shimbun-close): New method. + 2006-12-04 OHASHI Akira * mixi.el (mixi-url-encode-and-quote-percent-string): New function. diff --git a/sb-mixi.el b/sb-mixi.el index 645868d..c50fb52 100644 --- a/sb-mixi.el +++ b/sb-mixi.el @@ -70,17 +70,30 @@ of mixi object." :group 'shimbun :type 'boolean) +(defcustom shimbun-mixi-logout-p nil + "*If non-ni, Logout from mixi when shimbun server was closed." + :group 'shimbun + :type 'boolean) + (defvar shimbun-mixi-x-face-alist '(("default" . "X-Face: CY;j#FoBnpK^37`-IoJvN!J^u;GciiPmMQ@T)~RP1]t8iv?v)/bVI:I\"F!JfWJvhM5{zY!= h.d+'g\\I{D>Ocy?Rc4uYUyOZj2%2Kl>,x-!MCSsyi3!L}psrrC1jlF,O?Ui>qf)X;sBz`/}\\066X%$ siG'|4K!2?==|oB&#E'5GGH\\#z[muyQ"))) +(defmacro shimbun-mixi-initialize-comment-cache (shimbun) + `(shimbun-mixi-set-comment-cache-internal ,shimbun + (make-hash-table :test 'equal))) + (luna-define-method initialize-instance :after ((shimbun shimbun-mixi) &rest init-args) - (shimbun-mixi-set-comment-cache-internal shimbun - (make-hash-table :test 'equal)) + (shimbun-mixi-initialize-comment-cache shimbun) shimbun) +(luna-define-method shimbun-close :after ((shimbun shimbun-mixi)) + (shimbun-mixi-initialize-comment-cache shimbun) + (when shimbun-mixi-logout-p + (mixi-logout))) + (luna-define-method shimbun-groups ((shimbun shimbun-mixi)) (mapcar 'car shimbun-mixi-group-alist))