From fa73bd6385a00f21bb033955a716b86a880bd734 Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 25 Apr 1996 21:28:03 +0000 Subject: [PATCH] (rfc822/get-field-body): add new argument `boundary'; use function `rfc822/narrow-to-header'. --- tl-822.el | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tl-822.el b/tl-822.el index e998b01..7f3f1e7 100644 --- a/tl-822.el +++ b/tl-822.el @@ -30,7 +30,7 @@ (defconst rfc822/RCS-ID - "$Id: tl-822.el,v 7.19 1996-04-25 21:24:27 morioka Exp $") + "$Id: tl-822.el,v 7.20 1996-04-25 21:28:03 morioka Exp $") (defconst rfc822/version (get-version-string rfc822/RCS-ID)) @@ -54,15 +54,11 @@ (point) ) -(defun rfc822/get-field-body (name) +(defun rfc822/get-field-body (name &optional boundary) (let ((case-fold-search t)) (save-excursion (save-restriction - (narrow-to-region - (goto-char (point-min)) - (or (and (re-search-forward "^$" nil t) (match-end 0)) - (point-max) - )) + (rfc822/narrow-to-header boundary) (goto-char (point-min)) (if (re-search-forward (concat "^" name ":[ \t]*") nil t) (buffer-substring-no-properties @@ -102,11 +98,11 @@ (defun rfc822/narrow-to-header (&optional boundary) (narrow-to-region (goto-char (point-min)) - (progn - (re-search-forward - (concat "^\\(" (regexp-quote (or boundary "")) "\\)?$") - nil t) - (match-beginning 0) + (if (re-search-forward + (concat "^\\(" (regexp-quote + (or boundary "")) "\\)?$") nil t) + (match-end 0) + (point-max) ))) (defun rfc822/get-header-string (pat &optional boundary) -- 1.7.10.4