;;;
-;;; $Id: tm-mh-e3.el,v 7.0 1995/12/01 19:14:52 morioka Exp $
+;;; $Id: tm-mh-e3.el,v 7.1 1995/12/04 03:43:30 morioka Exp $
;;;
;;; This is a part of tm-mh-e.el which is a module for old mh-e
;;; to emulate mh-e 4.*.
;; May someday do completion on aliases.
(read-string prompt))
+(defvar mh-forward-subject-format "%s: %s"
+ "*Format to generate the Subject: line contents for a forwarded message.
+The two string arguments to the format are the sender of the original
+message and the original subject line.")
+
+(defun mh-forwarded-letter-subject (from subject)
+ ;; Return a Subject suitable for a forwarded message.
+ ;; Original message has headers FROM and SUBJECT.
+ (let ((addr-start (string-match "<" from))
+ (comment (string-match "(" 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))
+
;;; @ end
;;;