Function: mh-forwarded-letter-subject

mh-forwarded-letter-subject is a byte-compiled function defined in mh-comp.el.gz.

Signature

(mh-forwarded-letter-subject FROM SUBJECT)

Documentation

Return a Subject suitable for a forwarded message.

Original message has headers FROM and SUBJECT.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-comp.el.gz
(defun mh-forwarded-letter-subject (from subject)
  "Return a Subject suitable for a forwarded message.
Original message has headers FROM and SUBJECT."
  ;; Join continued lines.
  (setq from (replace-regexp-in-string "\\s *\n\\s +" " " from))
  (let ((addr-start (string-search "<" from))
        (comment (string-search "(" from)))
    (cond ((and addr-start (> addr-start 0))
           ;; Full Name <luser@host>
           (setq from (substring from 0 (1- addr-start))))
          (comment
           ;; luser@host (Full Name)
           (setq from (substring from (1+ comment) (1- (length from)))))))
  (format mh-forward-subject-format from subject))