From 05b5c011cd7ca609478807f9dd9e8803acd03b92 Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 28 May 1998 15:27:43 +0000 Subject: [PATCH] (std11-fetch-field): New function. (std11-field-body): Use 'std11-fetch-field. --- std11.el | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/std11.el b/std11.el index f36830d..080cae2 100644 --- a/std11.el +++ b/std11.el @@ -48,18 +48,24 @@ (point) ) +(defsubst std11-fetch-field (name) + "Return the value of the header field NAME. +The buffer is expected to be narrowed to just the headers of the message." + (save-excursion + (goto-char (point-min)) + (let ((case-fold-search t)) + (if (re-search-forward (concat "^" name ":[ \t]*") nil t) + (buffer-substring-no-properties (match-end 0) (std11-field-end)) + )))) + (defun std11-field-body (name &optional boundary) - "Return body of field NAME. -If BOUNDARY is not nil, it is used as message header separator. -\[std11.el]" + "Return the value of the header field NAME. +If BOUNDARY is not nil, it is used as message header separator." (save-excursion (save-restriction (std11-narrow-to-header boundary) - (goto-char (point-min)) - (let ((case-fold-search t)) - (if (re-search-forward (concat "^" name ":[ \t]*") nil t) - (buffer-substring-no-properties (match-end 0) (std11-field-end)) - ))))) + (std11-fetch-field name) + ))) (defun std11-find-field-body (field-names &optional boundary) "Return the first found field-body specified by FIELD-NAMES -- 1.7.10.4