(mime-visible-field-p): Moved to mmgeneric.el.
authortomo <tomo>
Thu, 2 Mar 2000 10:49:16 +0000 (10:49 +0000)
committertomo <tomo>
Thu, 2 Mar 2000 10:49:16 +0000 (10:49 +0000)
(mime-insert-header-from-buffer): Moved to mmgeneric.el.

mmbuffer.el
mmdbuffer.el
mmexternal.el

index b782025..c0a458b 100644 (file)
   )
 
 
-(defun mime-visible-field-p (field-name visible-fields invisible-fields)
-  (or (catch 'found
-       (while visible-fields
-         (let ((regexp (car visible-fields)))
-           (if (string-match regexp field-name)
-               (throw 'found t)
-             ))
-         (setq visible-fields (cdr visible-fields))
-         ))
-      (catch 'found
-       (while invisible-fields
-         (let ((regexp (car invisible-fields)))
-           (if (string-match regexp field-name)
-               (throw 'found nil)
-             ))
-         (setq invisible-fields (cdr invisible-fields))
-         )
-       t)))
-
-(defun mime-insert-header-from-buffer (buffer start end
-                                             &optional invisible-fields
-                                             visible-fields)
-  (let ((the-buf (current-buffer))
-       (mode-obj (mime-find-field-presentation-method 'wide))
-       field-decoder
-       f-b p f-e field-name len field field-body)
-    (save-excursion
-      (set-buffer buffer)
-      (save-restriction
-       (narrow-to-region start end)
-       (goto-char start)
-       (while (re-search-forward std11-field-head-regexp nil t)
-         (setq f-b (match-beginning 0)
-               p (match-end 0)
-               field-name (buffer-substring f-b p)
-               len (string-width field-name)
-               f-e (std11-field-end))
-         (when (mime-visible-field-p field-name
-                                     visible-fields invisible-fields)
-           (setq field (intern
-                        (capitalize (buffer-substring f-b (1- p))))
-                 field-body (buffer-substring p f-e)
-                 field-decoder (inline (mime-find-field-decoder-internal
-                                        field mode-obj)))
-           (with-current-buffer the-buf
-             (insert field-name)
-             (insert (if field-decoder
-                         (funcall field-decoder field-body len)
-                       ;; Don't decode
-                       field-body))
-             (insert "\n")
-             )))))))
-
 (luna-define-method mime-insert-header ((entity mime-buffer-entity)
                                        &optional invisible-fields
                                        visible-fields)
index 637eab3..c205957 100644 (file)
@@ -1,8 +1,6 @@
 ;;; mmdual.el --- MIME entity module for dual buffers
 
-;; Copyright (C) 1998,1999 Free Software Foundation, Inc.
-;; Copyright (C) 1999 Electrotechnical Laboratory, JAPAN.
-;; Licensed to the Free Software Foundation.
+;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
 ;; Keywords: MIME, multimedia, mail, news
   )
 
 
-(defun mime-visible-field-p (field-name visible-fields invisible-fields)
-  (or (catch 'found
-       (while visible-fields
-         (let ((regexp (car visible-fields)))
-           (if (string-match regexp field-name)
-               (throw 'found t)
-             ))
-         (setq visible-fields (cdr visible-fields))
-         ))
-      (catch 'found
-       (while invisible-fields
-         (let ((regexp (car invisible-fields)))
-           (if (string-match regexp field-name)
-               (throw 'found nil)
-             ))
-         (setq invisible-fields (cdr invisible-fields))
-         )
-       t)))
-
-(defun mime-insert-header-from-buffer (buffer start end
-                                             &optional invisible-fields
-                                             visible-fields)
-  (let ((the-buf (current-buffer))
-       (mode-obj (mime-find-field-presentation-method 'wide))
-       field-decoder
-       f-b p f-e field-name len field field-body)
-    (save-excursion
-      (set-buffer buffer)
-      (save-restriction
-       (narrow-to-region start end)
-       (goto-char start)
-       (while (re-search-forward std11-field-head-regexp nil t)
-         (setq f-b (match-beginning 0)
-               p (match-end 0)
-               field-name (buffer-substring f-b p)
-               len (string-width field-name)
-               f-e (std11-field-end))
-         (when (mime-visible-field-p field-name
-                                     visible-fields invisible-fields)
-           (setq field (intern
-                        (capitalize (buffer-substring f-b (1- p))))
-                 field-body (buffer-substring p f-e)
-                 field-decoder (inline (mime-find-field-decoder-internal
-                                        field mode-obj)))
-           (with-current-buffer the-buf
-             (insert field-name)
-             (insert (if field-decoder
-                         (funcall field-decoder field-body len)
-                       ;; Don't decode
-                       field-body))
-             (insert "\n")
-             )))))))
-
 (luna-define-method mime-insert-header ((entity mime-dual-entity)
                                        &optional invisible-fields
                                        visible-fields)
index eca9d94..ed413ab 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mmexternal.el --- MIME entity module for external buffer
 
-;; Copyright (C) 1998,1999 Free Software Foundation, Inc.
+;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
 ;; Keywords: MIME, multimedia, mail, news
            (mime-entity-parent-internal entity)))))
 
 
-;; [tomo] We should think about modularity about header presentation...
-
-(defun mime-visible-field-p (field-name visible-fields invisible-fields)
-  (or (catch 'found
-       (while visible-fields
-         (let ((regexp (car visible-fields)))
-           (if (string-match regexp field-name)
-               (throw 'found t)
-             ))
-         (setq visible-fields (cdr visible-fields))
-         ))
-      (catch 'found
-       (while invisible-fields
-         (let ((regexp (car invisible-fields)))
-           (if (string-match regexp field-name)
-               (throw 'found nil)
-             ))
-         (setq invisible-fields (cdr invisible-fields))
-         )
-       t)))
-
-(defun mime-insert-header-from-buffer (buffer start end
-                                             &optional invisible-fields
-                                             visible-fields)
-  (let ((the-buf (current-buffer))
-       (mode-obj (mime-find-field-presentation-method 'wide))
-       field-decoder
-       f-b p f-e field-name len field field-body)
-    (save-excursion
-      (set-buffer buffer)
-      (save-restriction
-       (narrow-to-region start end)
-       (goto-char start)
-       (while (re-search-forward std11-field-head-regexp nil t)
-         (setq f-b (match-beginning 0)
-               p (match-end 0)
-               field-name (buffer-substring f-b p)
-               len (string-width field-name)
-               f-e (std11-field-end))
-         (when (mime-visible-field-p field-name
-                                     visible-fields invisible-fields)
-           (setq field (intern
-                        (capitalize (buffer-substring f-b (1- p))))
-                 field-body (buffer-substring p f-e)
-                 field-decoder (inline (mime-find-field-decoder-internal
-                                        field mode-obj)))
-           (with-current-buffer the-buf
-             (insert field-name)
-             (insert (if field-decoder
-                         (funcall field-decoder field-body len)
-                       ;; Don't decode
-                       field-body))
-             (insert "\n")
-             )))))))
-
 (luna-define-method mime-insert-header ((entity mime-external-entity)
                                        &optional invisible-fields
                                        visible-fields)