Function: mh-identity-handler-default
mh-identity-handler-default is a byte-compiled function defined in
mh-identity.el.gz.
Signature
(mh-identity-handler-default FIELD ACTION TOP &optional VALUE)
Documentation
Process header FIELD.
The ACTION is one of remove or add. If TOP is non-nil, add the
field and its VALUE at the top of the header, else add it at the
bottom of the header. If action is add, the VALUE is added.
Source Code
;; Defined in /usr/src/emacs/lisp/mh-e/mh-identity.el.gz
(defun mh-identity-handler-default (field action top &optional value)
"Process header FIELD.
The ACTION is one of `remove' or `add'. If TOP is non-nil, add the
field and its VALUE at the top of the header, else add it at the
bottom of the header. If action is `add', the VALUE is added."
(let ((field-colon (if (string-match "^.*:$" field)
field
(concat field ":"))))
(cond
((equal action 'remove)
(mh-header-field-delete field-colon nil))
(t
(cond
;; No value, remove field
((or (not value)
(string= value ""))
(mh-header-field-delete field-colon nil))
;; Existing field, replace
((mh-header-field-delete field-colon t)
(insert value))
;; Other field, add at end or top
(t
(goto-char (point-min))
(if (not top)
(mh-goto-header-end 0))
(insert field-colon " " value "\n")))))))