From: morioka Date: Thu, 25 Apr 1996 16:08:35 +0000 (+0000) Subject: (rfc822/get-header-string): New function. X-Git-Tag: XEmacs-20_3-b27-viet~108 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68004e25e8aa312fca01d77cd06e0c647de60ac1;p=elisp%2Fmu-cite.git (rfc822/get-header-string): New function. --- diff --git a/tl-822.el b/tl-822.el index d99c666..3a7c1d7 100644 --- a/tl-822.el +++ b/tl-822.el @@ -30,7 +30,7 @@ (defconst rfc822/RCS-ID - "$Id: tl-822.el,v 7.16 1996-04-25 15:04:17 morioka Exp $") + "$Id: tl-822.el,v 7.17 1996-04-25 16:08:35 morioka Exp $") (defconst rfc822/version (get-version-string rfc822/RCS-ID)) @@ -100,6 +100,29 @@ ;;; @ header ;;; +(defun rfc822/get-header-string (pat boundary) + (let ((case-fold-search t)) + (save-excursion + (save-restriction + (narrow-to-region (goto-char (point-min)) + (progn + (re-search-forward + (concat "^\\(" (regexp-quote boundary) "\\)?$") + nil t) + (match-beginning 0) + )) + (goto-char (point-min)) + (let (field header) + (while (re-search-forward rfc822/field-top-regexp nil t) + (setq field (buffer-substring (match-beginning 0) + (rfc822/field-end) + )) + (if (string-match pat field) + (setq header (concat header field "\n")) + )) + header) + )))) + (defun rfc822/get-header-string-except (pat boundary) (let ((case-fold-search t)) (save-excursion