Function: mail-header-parse
mail-header-parse is a byte-compiled function defined in
mailheader.el.gz.
Signature
(mail-header-parse PARSING-RULES HEADERS)
Documentation
Apply PARSING-RULES to HEADERS.
PARSING-RULES is an alist whose keys are header names (symbols) and whose value is a parsing function. The function takes one argument, a string, and return a list of values, which will destructively replace the value associated with the key in HEADERS, after being prepended with the original value.
Source Code
;; Defined in /usr/src/emacs/lisp/mail/mailheader.el.gz
(defun mail-header-parse (parsing-rules headers)
"Apply PARSING-RULES to HEADERS.
PARSING-RULES is an alist whose keys are header names (symbols) and whose
value is a parsing function. The function takes one argument, a string,
and return a list of values, which will destructively replace the value
associated with the key in HEADERS, after being prepended with the original
value."
(dolist (rule parsing-rules)
(let ((header (assq (car rule) headers)))
(when header
(if (consp (cdr header))
(setf (cddr header) (funcall (cdr rule) (cadr header)))
(setf (cdr header)
(cons (cdr header) (funcall (cdr rule) (cdr header))))))))
headers)