;; The car of each element in the message-header alist is a symbol whose
;; print name is the name of the header, in all lower-case. The cdr of an
;; element depends on the operation. After extracting headers from a
-;; messge, it is a string, the value of the header. An extracted set of
+;; message, it is a string, the value of the header. An extracted set of
;; headers may be parsed further, which may turn it into a list, whose car
;; is the original value and whose subsequent elements depend on the
;; header. For formatting, it is evaluated to obtain the strings to be
(> (skip-chars-forward "^\0- :") 0)
(= (following-char) ?:)
(setq end (point))
- (progn (forward-char)
+ (progn (forward-char)
(> (skip-chars-forward " \t") 0)))
(let ((header (intern (downcase (buffer-substring start end))))
(value (list (buffer-substring
value))
(push (if (cdr value)
(cons header (mapconcat #'identity (nreverse value) " "))
- (cons header (car value)))
+ (cons header (car value)))
message-headers)))
(goto-char top)
(nreverse message-headers)))
"Return the value associated with header HEADER in HEADER-ALIST.
If the value is a string, it is the original value of the header. If the
value is a list, its first element is the original value of the header,
-with any subsequent elements bing the result of parsing the value.
+with any subsequent elements being the result of parsing the value.
If HEADER-ALIST is nil, the dynamically bound variable `headers' is used."
(cdr (assq header (or header-alist headers))))
HEADER-ALIST defaults to the dynamically bound variable `headers' if nil.
See `mail-header' for the semantics of VALUE."
(let* ((alist (or header-alist headers))
- (entry (assq header alist)))
+ (entry (assq header alist)))
(if entry
(setf (cdr entry) value)
- (nconc alist (list (cons header value)))))
+ (nconc alist (list (cons header value)))))
value)
(defsetf mail-header (header &optional header-alist) (value)
(mapcar #'car format-rules))))
(dolist (rule format-rules)
(let* ((header (car rule))
- (value (mail-header header)))
+ (value (mail-header header)))
(cond ((null header) 'ignore)
((eq header t)
(dolist (defaulted headers)
(value (cdr defaulted)))
(if (cdr rule)
(funcall (cdr rule) header value)
- (funcall mail-header-format-function header value))))))
+ (funcall mail-header-format-function header value))))))
(value
(if (cdr rule)
(funcall (cdr rule) header value)
- (funcall mail-header-format-function header value))))))
+ (funcall mail-header-format-function header value))))))
(insert "\n")))
(provide 'mailheader)