2 ;;; $Id: tm-mh-e3.el,v 1.1 1994/07/10 20:03:10 morioka Exp morioka $
4 ;;; This is a part of tm-mh-e.el which is a module for old mh-e
5 ;;; to emulate mh-e 4.0.
7 ;;; This module imports from mh-e 3.8 and 4.0.
12 ;;; Ensure new buffers won't get this mode if default-major-mode is nil.
13 (put 'mh-show-mode 'mode-class 'special)
15 (defun mh-show-mode ()
16 "Major mode for showing messages in mh-e.
17 The value of mh-show-mode-hook is called when a new message is displayed."
18 (kill-all-local-variables)
19 (setq major-mode 'mh-show-mode)
20 (mh-set-mode-name "MH-Show")
21 (run-hooks 'mh-show-mode-hook))
23 (defun mh-display-msg (msg-num folder)
24 ;; Display message NUMBER of FOLDER.
25 ;; Sets the current buffer to the show buffer.
27 ;; Bind variables in folder buffer in case they are local
28 (let ((formfile mhl-formfile)
29 (clean-message-header mh-clean-message-header)
30 (invisible-headers mh-invisible-headers)
31 (visible-headers mh-visible-headers)
32 (msg-filename (mh-msg-filename msg-num))
33 (show-buffer mh-show-buffer)
34 (folder mh-current-folder))
35 (if (not (file-exists-p msg-filename))
36 (error "Message %d does not exist" msg-num))
37 (switch-to-buffer show-buffer)
38 (if mh-bury-show-buffer (bury-buffer (current-buffer)))
39 (mh-when (or (not (equal msg-filename buffer-file-name)))
40 ;; Buffer does not yet contain message.
41 (clear-visited-file-modtime)
43 (setq buffer-file-name nil) ; no locking during setup
46 (if (stringp formfile)
47 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
48 "-form" formfile msg-filename)
49 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
51 (insert-file-contents msg-filename))
52 (goto-char (point-min))
53 (cond (clean-message-header
54 (mh-clean-msg-header (point-min)
57 (goto-char (point-min)))
59 (let ((case-fold-search t))
61 "^To:\\|^From:\\|^Subject:\\|^Date:" nil t)
64 (set-buffer-modified-p nil)
65 (setq buffer-file-name msg-filename)
68 (setq mode-line-buffer-identification
69 (list (format mh-show-buffer-mode-line-buffer-id
72 (fset 'mh-show-msg 'mh-show)