(TopLevel): Require `mmgeneric' always.
authorkeiichi <keiichi>
Tue, 18 Jul 2000 07:14:15 +0000 (07:14 +0000)
committerkeiichi <keiichi>
Tue, 18 Jul 2000 07:14:15 +0000 (07:14 +0000)
(mmgnus-entiry::mime-entity-fetch-field): Define method.
(mmgnus-entiry::mime-entity-body): Do not error.
(mmgnus-entiry::mime-insert-text-content): Define method.
(mmgnus-entiry::mime-insert-entity-body): Ditto.
(mime-gnus-entity::mime-entity-fetch-field): Ditto.
(mime-gnus-entity::mime-entity-body): Ditto.
(mime-gnus-entity::mime-entity-content): Ditto.
(mime-gnus-entity::mime-insert-entity-content): Ditto.
(mime-gnus-entity::mime-insert-text-content): Ditto.
(mime-gnus-entity::mime-write-entity-content): Ditto.
(mime-gnus-entity::mime-insert-entity): Ditto.
(mime-gnus-entity::mime-write-entity): Ditto.
(mime-gnus-entity::mime-insert-entity-body): Ditto.
(mime-gnus-entity::mime-write-entity-body): Ditto.

lisp/mmgnus.el

index 534d704..e858dc9 100644 (file)
@@ -25,9 +25,7 @@
 
 ;;; Code:
 
-(condition-case nil
-    (require 'mmgeneric)
-  (error nil))
+(require 'mmgeneric)
 (require 'mime)
 (require 'eword-decode)
 
    (mmgnus-entity-header-internal entity)
    invisible-fields visible-fields))
 
+(luna-define-method mime-entity-fetch-field :around
+  ((entity mmgnus-entity) field-name)
+  (or (luna-call-next-method)
+      (let* ((header (mmgnus-entity-header-internal entity))
+            (case-fold-search t)
+            (ret (and header
+                      (string-match 
+                       (concat "^" field-name
+                               ":[ \t]+\\(.*\\(\n[ \t]+.*\\)*\\)\n")
+                       header)
+                      (match-string 1 header))))
+       (when ret
+         (or (symbolp field-name)
+             (setq field-name
+                   (intern (capitalize (capitalize field-name)))))
+         (mime-entity-set-original-header-internal
+          entity
+          (put-alist field-name ret
+                     (mime-entity-original-header-internal entity)))
+         ret))))
+
 (luna-define-method mime-entity-body ((entity mmgnus-entity))
    (cond
     ((bufferp (mmgnus-entity-body-internal entity))
      (with-current-buffer (mmgnus-entity-body-internal entity)
        (buffer-string)))
     (t
-     (error "Invalid body object. %s"
-           (mmgnus-entity-body-internal entity)))))
+     (message "Invalid body object. %s"
+             (mmgnus-entity-body-internal entity))
+     "")))
 
 (luna-define-method mime-entity-content ((entity mmgnus-entity))
   (mime-decode-string (mime-entity-body entity)
 (luna-define-method mime-insert-entity-content ((entity mmgnus-entity))
   (insert (mime-entity-content entity)))
 
+(luna-define-method mime-insert-text-content ((entity mmgnus-entity))
+  (insert
+   (decode-mime-charset-string (mime-entity-content entity)
+                              (or (mime-content-type-parameter
+                                   (mime-entity-content-type entity)
+                                   "charset")
+                                  default-mime-charset)
+                              'CRLF)))
+
 (luna-define-method mime-write-entity-content ((entity mmgnus-entity) filename)
   (with-temp-buffer
     (insert (mime-entity-body entity))
     (mime-insert-entity entity)
     (write-region-as-raw-text-CRLF (point-min) (point-max) filename)))
 
+(luna-define-method mime-insert-entity-body ((entity mmgnus-entity))
+  (insert (mime-entity-body entity)))
+
 (luna-define-method mime-write-entity-body ((entity mmgnus-entity) filename)
   (with-temp-buffer
     (insert (mime-entity-body entity))
 (luna-define-method mime-entity-content :around ((entity mime-gnus-entity))
   (luna-call-next-method))
 
+(luna-define-method mime-entity-fetch-field :around ((entity mime-gnus-entity)
+                                                    field-name)
+  (luna-call-next-method))
+
+(luna-define-method mime-entity-body :around ((entity mime-gnus-entity))
+  (luna-call-next-method))
+
+(luna-define-method mime-entity-content :around ((entity mime-gnus-entity))
+  (luna-call-next-method))
+
+(luna-define-method mime-insert-entity-content :around
+  ((entity mime-gnus-entity))
+  (luna-call-next-method))
+
+(luna-define-method mime-insert-text-content :around
+  ((entity mime-gnus-entity))
+  (luna-call-next-method))
+
+(luna-define-method mime-write-entity-content :around
+  ((entity mime-gnus-entity) filename)
+  (luna-call-next-method))
+
+(luna-define-method mime-insert-entity :around ((entity mime-gnus-entity))
+  (luna-call-next-method))
+
+(luna-define-method mime-write-entity :around ((entity mime-gnus-entity)
+                                              filename)
+  (luna-call-next-method))
+
+(luna-define-method mime-insert-entity-body :around ((entity mime-gnus-entity))
+  (luna-call-next-method))
+
+(luna-define-method mime-write-entity-body :around ((entity mime-gnus-entity)
+                                                   filename)
+  (luna-call-next-method))
+
 ;;; @ end
 ;;;