2 ;;; $Id: tm-mh-e3.el,v 7.1 1995/12/04 03:43:30 morioka Exp $
4 ;;; This is a part of tm-mh-e.el which is a module for old mh-e
5 ;;; to emulate mh-e 4.*.
7 ;;; This module imports from mh-e 4.1.
13 (defvar mail-citation-hook nil
14 "*Hook for modifying a citation just inserted in the mail buffer.
15 Each hook function can find the citation between point and mark.
16 And each hook function should leave point and mark around the citation
20 ;;; Ensure new buffers won't get this mode if default-major-mode is nil.
21 (put 'mh-show-mode 'mode-class 'special)
23 (defun mh-show-mode ()
24 "Major mode for showing messages in mh-e.
25 The value of mh-show-mode-hook is called when a new message is displayed."
26 (kill-all-local-variables)
27 (setq major-mode 'mh-show-mode)
28 (mh-set-mode-name "MH-Show")
29 (run-hooks 'mh-show-mode-hook))
31 (defun mh-start-of-uncleaned-message ()
32 ;; position uninteresting headers off the top of the window
33 (let ((case-fold-search t))
35 "^To:\\|^From:\\|^Subject:\\|^Date:" nil t)
39 (fset 'mh-show-msg (symbol-function 'mh-show))
42 ;;; @ mh-comp definitions
47 (defun mh-read-address (prompt)
48 ;; Read a To: or Cc: address, prompting in the minibuffer with PROMPT.
49 ;; May someday do completion on aliases.
52 (defvar mh-forward-subject-format "%s: %s"
53 "*Format to generate the Subject: line contents for a forwarded message.
54 The two string arguments to the format are the sender of the original
55 message and the original subject line.")
57 (defun mh-forwarded-letter-subject (from subject)
58 ;; Return a Subject suitable for a forwarded message.
59 ;; Original message has headers FROM and SUBJECT.
60 (let ((addr-start (string-match "<" from))
61 (comment (string-match "(" from)))
62 (cond ((and addr-start (> addr-start 0))
63 ;; Full Name <luser@host>
64 (setq from (substring from 0 (1- addr-start))))
66 ;; luser@host (Full Name)
67 (setq from (substring from (1+ comment) (1- (length from)))))))
68 (format mh-forward-subject-format from subject))