From 62c893bec4a4ebed986d7d9be1cc99f9cafc851c Mon Sep 17 00:00:00 2001 From: tomo Date: Sun, 16 Jan 2000 07:17:19 +0000 Subject: [PATCH] Must require alist. (postpet-decode): Add autoload cookie. (mime-display-application/x-postpet): Likewise. --- postpet.el | 57 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/postpet.el b/postpet.el index 1b4aaf9..f8730bb 100644 --- a/postpet.el +++ b/postpet.el @@ -24,6 +24,8 @@ ;;; Code: +(require 'alist) + (put 'unpack 'lisp-indent-function 1) (defmacro unpack (string &rest body) `(let* ((*unpack*string* (string-as-unibyte ,string)) @@ -58,6 +60,7 @@ (defun unpack-string-sjis () (decode-mime-charset-string (unpack-string) 'shift_jis)) +;;;###autoload (defun postpet-decode (string) (condition-case nil (unpack string @@ -96,29 +99,47 @@ res)) (error nil))) +;;;###autoload (defun mime-display-application/x-postpet (entity situation) (save-restriction (narrow-to-region (point-max)(point-max)) (let ((pet (postpet-decode (mime-entity-content entity)))) (if pet - (insert "Petname: " (cdr (assq 'petname pet)) "\n" - "Owner: " (cdr (assq 'owner pet)) "\n" - "Pettype: " (cdr (assq 'pettype pet)) "\n" - "From: " (cdr (assq 'from pet)) "\n" - "CarryingCount: " (int-to-string (cdr (assq 'carryingcount pet))) "\n" - "SentYear: " (int-to-string (cdr (assq 'sentyear pet))) "\n" - "SentMonth: " (int-to-string (cdr (assq 'sentmonth pet))) "\n" - "SentDay: " (int-to-string (cdr (assq 'sentday pet))) "\n" - "PetbirthYear: " (int-to-string (cdr (assq 'petbirthyear pet))) "\n" - "PetbirthMonth: " (int-to-string (cdr (assq 'petbirthmonth pet))) "\n" - "PetbirthDay: " (int-to-string (cdr (assq 'petbirthday pet))) "\n" - "Health: " (int-to-string (cdr (assq 'health pet))) "\n" - "Sex: " (int-to-string (cdr (assq 'sex pet))) "\n" - "Brain: " (int-to-string (cdr (assq 'brain pet))) "\n" - "Happiness: " (int-to-string (cdr (assq 'happiness pet))) "\n" - "Treasure: " (int-to-string (cdr (assq 'treasure pet))) "\n" - "Money: " (int-to-string (cdr (assq 'money pet))) "\n" - ) + (insert + "Petname: " (cdr (assq 'petname pet)) + "\n" + "Owner: " (cdr (assq 'owner pet)) + "\n" + "Pettype: " (cdr (assq 'pettype pet)) + "\n" + "From: " (cdr (assq 'from pet)) + "\n" + "CarryingCount: " (int-to-string (cdr (assq 'carryingcount pet))) + "\n" + "SentYear: " (int-to-string (cdr (assq 'sentyear pet))) + "\n" + "SentMonth: " (int-to-string (cdr (assq 'sentmonth pet))) + "\n" + "SentDay: " (int-to-string (cdr (assq 'sentday pet))) + "\n" + "PetbirthYear: " (int-to-string (cdr (assq 'petbirthyear pet))) + "\n" + "PetbirthMonth: " (int-to-string (cdr (assq 'petbirthmonth pet))) + "\n" + "PetbirthDay: " (int-to-string (cdr (assq 'petbirthday pet))) + "\n" + "Health: " (int-to-string (cdr (assq 'health pet))) + "\n" + "Sex: " (int-to-string (cdr (assq 'sex pet))) + "\n" + "Brain: " (int-to-string (cdr (assq 'brain pet))) + "\n" + "Happiness: " (int-to-string (cdr (assq 'happiness pet))) + "\n" + "Treasure: " (int-to-string (cdr (assq 'treasure pet))) + "\n" + "Money: " (int-to-string (cdr (assq 'money pet))) + "\n") (insert "Invalid format\n")) (run-hooks 'mime-display-application/x-postpet-hook)))) -- 1.7.10.4