(defmacro mixi-message (&rest strings)
`(concat "[mixi] " ,@strings))
+(put 'mixi-realization-error
+ 'error-message (mixi-message "Cannot realize object"))
+(put 'mixi-realization-error
+ 'error-conditions '(mixi-realization-error error))
+
+(defmacro mixi-realization-error (type object)
+ `(signal 'mixi-realization-error (list ,type ,object buffer)))
+
(defconst mixi-message-adult-contents
"¤³¤Î¥Ú¡¼¥¸¤«¤éÀè¤Ï¥¢¥À¥ë¥È¡ÊÀ®¿Í¸þ¤±¡Ë¥³¥ó¥Æ¥ó¥Ä¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£<br>
±ÜÍ÷¤ËƱ°Õ¤µ¤ì¤¿Êý¤Î¤ß¡¢Àè¤Ø¤ª¿Ê¤ß¤¯¤À¤µ¤¤¡£")
(setq buf buffer))
(if (string-match mixi-friend-nick-regexp buf)
(mixi-friend-set-nick friend (match-string 1 buf))
- (signal 'error (list 'cannot-find-nick friend)))
+ (mixi-realization-error 'cannot-find-nick friend))
;; For getting my profile.
(unless (string-match mixi-friend-name-regexp buf)
(with-mixi-retrieve (concat "/show_profile.pl?id="
(setq buf buffer)))
(if (string-match mixi-friend-name-regexp buf)
(mixi-friend-set-name friend (match-string 2 buf))
- (signal 'error (list 'cannot-find-name friend)))
+ (mixi-realization-error 'cannot-find-name friend))
(if (string-match mixi-friend-sex-regexp buf)
(mixi-friend-set-sex friend
(if (string= (match-string 3 buf) "ÃË")
'male 'female))
- (signal 'error (list 'cannot-find-sex friend)))
+ (mixi-realization-error 'cannot-find-sex friend))
(when (string-match mixi-friend-address-regexp buf)
(mixi-friend-set-address friend (match-string 1 buf)))
(when (string-match mixi-friend-age-regexp buf)
(if (string-match mixi-diary-owner-nick-regexp buffer)
(mixi-friend-set-nick (mixi-diary-owner diary)
(match-string 1 buffer))
- (signal 'error (list 'cannot-find-owner-nick diary)))
+ (mixi-realization-error 'cannot-find-owner-nick diary))
(if (string-match mixi-diary-time-regexp buffer)
(mixi-diary-set-time
diary (encode-time 0 (string-to-number (match-string 10 buffer))
(string-to-number (match-string 7 buffer))
(string-to-number (match-string 6 buffer))
(string-to-number (match-string 5 buffer))))
- (signal 'error (list 'cannot-find-time diary)))
+ (mixi-realization-error 'cannot-find-time diary))
(if (string-match mixi-diary-title-regexp buffer)
(mixi-diary-set-title diary (match-string 2 buffer))
- (signal 'error (list 'cannot-find-title diary)))
+ (mixi-realization-error 'cannot-find-title diary))
(if (string-match mixi-diary-content-regexp buffer)
(mixi-diary-set-content diary (match-string 2 buffer))
- (signal 'error (list 'cannot-find-content diary)))))
+ (mixi-realization-error 'cannot-find-content diary))))
(mixi-object-touch diary)))
(defun mixi-diary-owner (diary)
(mixi-community-set-name community "¥Ç¡¼¥¿¤¬¤¢¤ê¤Þ¤»¤ó")
(if (string-match mixi-community-name-regexp buffer)
(mixi-community-set-name community (match-string 1 buffer))
- (signal 'error (list 'cannot-find-name community)))
+ (mixi-realization-error 'cannot-find-name community))
(if (string-match mixi-community-birthday-regexp buffer)
(mixi-community-set-birthday
community
(encode-time 0 0 0 (string-to-number (match-string 3 buffer))
(string-to-number (match-string 2 buffer))
(string-to-number (match-string 1 buffer))))
- (signal 'error (list 'cannot-find-birthday community)))
+ (mixi-realization-error 'cannot-find-birthday community))
(if (string-match mixi-community-owner-regexp buffer)
(if (string= (match-string 1 buffer) "home.pl")
(mixi-community-set-owner community (mixi-make-me))
(mixi-community-set-owner
community (mixi-make-friend (match-string 2 buffer)
(match-string 3 buffer))))
- (signal 'error (list 'cannot-find-owner community)))
+ (mixi-realization-error 'cannot-find-owner community))
(if (string-match mixi-community-category-regexp buffer)
(mixi-community-set-category community (match-string 1 buffer))
- (signal 'error (list 'cannot-find-category community)))
+ (mixi-realization-error 'cannot-find-category community))
(if (string-match mixi-community-members-regexp buffer)
(mixi-community-set-members
community (string-to-number (match-string 1 buffer)))
- (signal 'error (list 'cannot-find-members community)))
+ (mixi-realization-error 'cannot-find-members community))
(if (string-match mixi-community-open-level-regexp buffer)
(mixi-community-set-open-level community (match-string 1 buffer))
- (signal 'error (list 'cannot-find-open-level community)))
+ (mixi-realization-error 'cannot-find-open-level community))
(if (string-match mixi-community-authority-regexp buffer)
(mixi-community-set-authority community (match-string 1 buffer))
- (signal 'error (list 'cannot-find-authority community)))
+ (mixi-realization-error 'cannot-find-authority community))
(if (string-match mixi-community-description-regexp buffer)
(mixi-community-set-description community (match-string 1 buffer))
- (signal 'error (list 'cannot-find-description community)))))
+ (mixi-realization-error 'cannot-find-description community))))
(mixi-object-touch community)))
(defun mixi-community-id (community)
(if (string-match mixi-topic-community-regexp buffer)
(mixi-community-set-name (mixi-topic-community topic)
(match-string 1 buffer))
- (signal 'error (list 'cannot-find-community topic)))
+ (mixi-realization-error 'cannot-find-community topic))
(if (string-match mixi-topic-time-regexp buffer)
(mixi-topic-set-time
topic (encode-time 0 (string-to-number (match-string 5 buffer))
(string-to-number (match-string 3 buffer))
(string-to-number (match-string 2 buffer))
(string-to-number (match-string 1 buffer))))
- (signal 'error (list 'cannot-find-time topic)))
+ (mixi-realization-error 'cannot-find-time topic))
(if (string-match mixi-topic-title-regexp buffer)
(mixi-topic-set-title topic (match-string 1 buffer))
- (signal 'error (list 'cannot-find-title topic)))
+ (mixi-realization-error 'cannot-find-title topic))
(if (string-match mixi-topic-owner-regexp buffer)
(mixi-topic-set-owner topic
(mixi-make-friend (match-string 1 buffer)
(match-string 2 buffer)))
- (signal 'error (list 'cannot-find-owner topic)))
+ (mixi-realization-error 'cannot-find-owner topic))
(if (string-match mixi-topic-content-regexp buffer)
(mixi-topic-set-content topic (match-string 2 buffer))
- (signal 'error (list 'cannot-find-content topic))))
+ (mixi-realization-error 'cannot-find-content topic)))
(mixi-object-touch topic)))
(defun mixi-topic-community (topic)
(if (string-match mixi-event-community-regexp buffer)
(mixi-community-set-name (mixi-event-community event)
(match-string 1 buffer))
- (signal 'error (list 'cannot-find-title event)))
+ (mixi-realization-error 'cannot-find-title event))
(if (string-match mixi-event-time-regexp buffer)
(mixi-event-set-time
event (encode-time 0 (string-to-number (match-string 5 buffer))
(string-to-number (match-string 3 buffer))
(string-to-number (match-string 2 buffer))
(string-to-number (match-string 1 buffer))))
- (signal 'error (list 'cannot-find-time event)))
+ (mixi-realization-error 'cannot-find-time event))
(if (string-match mixi-event-title-regexp buffer)
(mixi-event-set-title event (match-string 1 buffer))
- (signal 'error (list 'cannot-find-title event)))
+ (mixi-realization-error 'cannot-find-title event))
(if (string-match mixi-event-owner-regexp buffer)
(mixi-event-set-owner event
(mixi-make-friend (match-string 1 buffer)
(match-string 2 buffer)))
- (signal 'error (list 'cannot-find-owner event)))
+ (mixi-realization-error 'cannot-find-owner event))
(if (string-match mixi-event-date-regexp buffer)
(mixi-event-set-date event (match-string 1 buffer))
- (signal 'error (list 'cannot-find-date event)))
+ (mixi-realization-error 'cannot-find-date event))
(if (string-match mixi-event-place-regexp buffer)
(mixi-event-set-place event (match-string 1 buffer))
- (signal 'error (list 'cannot-find-place event)))
+ (mixi-realization-error 'cannot-find-place event))
(if (string-match mixi-event-detail-regexp buffer)
(mixi-event-set-detail event (match-string 1 buffer))
- (signal 'error (list 'cannot-find-detail event)))
+ (mixi-realization-error 'cannot-find-detail event))
(when (string-match mixi-event-limit-regexp buffer)
(mixi-event-set-limit
event (encode-time 0 0 0 (string-to-number (match-string 3 buffer))
(string-to-number (match-string 1 buffer)))))
(if (string-match mixi-event-members-regexp buffer)
(mixi-event-set-members event (match-string 1 buffer))
- (signal 'error (list 'cannot-find-members event))))
+ (mixi-realization-error 'cannot-find-members event)))
(mixi-object-touch event)))
(defun mixi-event-community (event)
(mixi-message-set-owner message
(mixi-make-friend (match-string 2 buffer)
(match-string 3 buffer)))
- (signal 'error (list 'cannot-find-owner message)))
+ (mixi-realization-error 'cannot-find-owner message))
(if (string-match mixi-message-title-regexp buffer)
(mixi-message-set-title message (match-string 2 buffer))
- (signal 'error (list 'cannot-find-title message)))
+ (mixi-realization-error 'cannot-find-title message))
(if (string-match mixi-message-time-regexp buffer)
(mixi-message-set-time
message (encode-time 0 (string-to-number (match-string 6 buffer))
(string-to-number (match-string 4 buffer))
(string-to-number (match-string 3 buffer))
(string-to-number (match-string 2 buffer))))
- (signal 'error (list 'cannot-find-time message)))
+ (mixi-realization-error 'cannot-find-time message))
(if (string-match mixi-message-content-regexp buffer)
(mixi-message-set-content message (match-string 1 buffer))
- (signal 'error (list 'cannot-find-content message))))
+ (mixi-realization-error 'cannot-find-content message)))
(mixi-object-touch message)))
(defun mixi-message-id (message)