Function: mail-header-set

mail-header-set is a byte-compiled function defined in mailheader.el.gz.

This function is obsolete since 28.1; use alist-get instead.

Signature

(mail-header-set HEADER VALUE &optional HEADER-ALIST)

Documentation

Set the value associated with header HEADER to VALUE in HEADER-ALIST.

HEADER-ALIST defaults to the dynamically bound variable headers if nil. See mail-header for the semantics of VALUE.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/mailheader.el.gz
(defun mail-header-set (header value &optional header-alist)
  "Set the value associated with header HEADER to VALUE in HEADER-ALIST.
HEADER-ALIST defaults to the dynamically bound variable `headers' if nil.
See `mail-header' for the semantics of VALUE."
  (declare (obsolete alist-get "28.1"))
  (with-suppressed-warnings ((lexical headers)) (defvar headers))
  (let* ((alist (or header-alist headers))
	(entry (assq header alist)))
    (if entry
	(setf (cdr entry) value)
	(nconc alist (list (cons header value)))))
  value)