Function: mail-hist-add-header-contents-to-ring

mail-hist-add-header-contents-to-ring is a byte-compiled function defined in mail-hist.el.gz.

Signature

(mail-hist-add-header-contents-to-ring HEADER &optional CONTENTS)

Documentation

Add the contents of HEADER to the header history ring.

Optional argument CONTENTS is a string which will be the contents
(instead of whatever's found in the header).

Source Code

;; Defined in /usr/src/emacs/lisp/mail/mail-hist.el.gz
(defsubst mail-hist-add-header-contents-to-ring (header &optional contents)
  "Add the contents of HEADER to the header history ring.
Optional argument CONTENTS is a string which will be the contents
\(instead of whatever's found in the header)."
  (setq header (downcase header))
  (let ((ctnts (or contents (mail-hist-current-header-contents)))
        (ring  (cdr (assoc header mail-hist-header-ring-alist))))
    (if (mail-hist-text-too-long-p ctnts) (setq ctnts ""))
    (or ring
        ;; If the ring doesn't exist, we'll have to make it and add it
        ;; to the mail-header-ring-alist:
        (prog1
            (setq ring (make-ring mail-hist-history-size))
          (setq mail-hist-header-ring-alist
                (cons (cons header ring) mail-hist-header-ring-alist))))
    (ring-insert ring ctnts)))