(std11-field-bodies): New function.
authormorioka <morioka>
Wed, 28 Aug 1996 13:13:12 +0000 (13:13 +0000)
committermorioka <morioka>
Wed, 28 Aug 1996 13:13:12 +0000 (13:13 +0000)
std11.el

index 36ffe43..eae9d83 100644 (file)
--- a/std11.el
+++ b/std11.el
@@ -4,7 +4,7 @@
 
 ;; Author:   MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;; Keywords: mail, news, RFC 822, STD 11
-;; Version: $Id: std11.el,v 0.4 1996-08-28 13:03:23 morioka Exp $
+;; Version: $Id: std11.el,v 0.5 1996-08-28 13:13:12 morioka Exp $
 
 ;; This file is part of tl (Tiny Library).
 
   (point)
   )
 
+(defun std11-field-names (&optional boundary)
+  (save-excursion
+    (save-restriction
+      (std11-narrow-to-header boundary)
+      (goto-char (point-min))
+      (let (dest name)
+       (while (re-search-forward std11-field-head-regexp nil t)
+         (setq name (buffer-substring-no-properties
+                     (match-beginning 0)(1- (match-end 0))))
+         (or (member name dest)
+             (setq dest (cons name dest))
+             )
+         )
+       dest))))
+
+(defun std11-field-bodies (field-names &optional default-value boundary)
+  (save-excursion
+    (save-restriction
+      (std11-narrow-to-header boundary)
+      (let* ((case-fold-search t)
+            (dest (make-list (length field-names) default-value))
+            (s-rest field-names)
+            (d-rest dest)
+            field-name)
+       (while (setq field-name (car s-rest))
+         (goto-char (point-min))
+         (if (re-search-forward (concat "^" field-name ":[ \t]*") nil t)
+             (setcar d-rest
+                     (buffer-substring-no-properties
+                      (match-end 0) (std11-field-end)))
+           )
+         (setq s-rest (cdr s-rest)
+               d-rest (cdr d-rest))
+         )
+       dest))))
+
 
 ;;; @ header
 ;;;
          header)
        ))))
 
-(defun std11-field-names (&optional boundary)
-  (save-excursion
-    (save-restriction
-      (std11-narrow-to-header boundary)
-      (goto-char (point-min))
-      (let (dest name)
-       (while (re-search-forward std11-field-head-regexp nil t)
-         (setq name (buffer-substring-no-properties
-                     (match-beginning 0)(1- (match-end 0))))
-         (or (member name dest)
-             (setq dest (cons name dest))
-             )
-         )
-       dest))))
-
 
 ;;; @ end
 ;;;