From 965b458bc8b4cd9d9481dae5a5a7be231289d564 Mon Sep 17 00:00:00 2001 From: tomo Date: Thu, 2 Mar 2000 10:49:16 +0000 Subject: [PATCH] (mime-visible-field-p): Moved to mmgeneric.el. (mime-insert-header-from-buffer): Moved to mmgeneric.el. --- mmbuffer.el | 53 ----------------------------------------------------- mmdbuffer.el | 57 +-------------------------------------------------------- mmexternal.el | 57 +-------------------------------------------------------- 3 files changed, 2 insertions(+), 165 deletions(-) diff --git a/mmbuffer.el b/mmbuffer.el index b782025..c0a458b 100644 --- a/mmbuffer.el +++ b/mmbuffer.el @@ -86,59 +86,6 @@ ) -(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) diff --git a/mmdbuffer.el b/mmdbuffer.el index 637eab3..c205957 100644 --- a/mmdbuffer.el +++ b/mmdbuffer.el @@ -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 ;; Keywords: MIME, multimedia, mail, news @@ -63,59 +61,6 @@ ) -(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) diff --git a/mmexternal.el b/mmexternal.el index eca9d94..ed413ab 100644 --- a/mmexternal.el +++ b/mmexternal.el @@ -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 ;; Keywords: MIME, multimedia, mail, news @@ -45,61 +45,6 @@ (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) -- 1.7.10.4