From 8f5e968ad4dff4d5e51e85b7f49e37ee738e5ee5 Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 25 Jun 1998 14:21:46 +0000 Subject: [PATCH] Move function `eword-visible-field-p' and `mime-insert-decoded-header'. --- eword-decode.el | 77 ------------------------------------------------------- 1 file changed, 77 deletions(-) diff --git a/eword-decode.el b/eword-decode.el index 5280aeb..f0e74e5 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -254,83 +254,6 @@ If SEPARATOR is not nil, it is used as header separator." )) ))) -(defun eword-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-decoded-header (entity - &optional invisible-fields visible-fields - code-conversion) - "Insert before point a decoded header of ENTITY." - (let ((default-charset - (if code-conversion - (if (mime-charset-to-coding-system code-conversion) - code-conversion - default-mime-charset)))) - (save-restriction - (narrow-to-region (point)(point)) - (let ((the-buf (current-buffer)) - (src-buf (mime-entity-buffer entity)) - (h-end (mime-entity-header-end entity)) - beg p end field-name len field) - (save-excursion - (set-buffer src-buf) - (goto-char (mime-entity-header-start entity)) - (save-restriction - (narrow-to-region (point) h-end) - (while (re-search-forward std11-field-head-regexp nil t) - (setq beg (match-beginning 0) - p (match-end 0) - field-name (buffer-substring beg (1- p)) - len (string-width field-name) - end (std11-field-end)) - (when (eword-visible-field-p field-name - visible-fields invisible-fields) - (setq field (intern (capitalize field-name))) - (save-excursion - (set-buffer the-buf) - (insert field-name) - (insert ":") - (cond ((memq field eword-decode-ignored-field-list) - ;; Don't decode - (insert-buffer-substring src-buf p end) - ) - ((memq field eword-decode-structured-field-list) - ;; Decode as structured field - (let ((body (save-excursion - (set-buffer src-buf) - (buffer-substring p end))) - (default-mime-charset default-charset)) - (insert (eword-decode-and-fold-structured-field - body (1+ len))) - )) - (t - ;; Decode as unstructured field - (let ((body (save-excursion - (set-buffer src-buf) - (buffer-substring p end))) - (default-mime-charset default-charset)) - (insert (eword-decode-unstructured-field-body - body (1+ len))) - ))) - (insert "\n") - ))))))))) - ;;; @ encoded-word decoder ;;; -- 1.7.10.4