2 ;;; $Id: tm-mh-e3.el,v 1.2 1994/11/01 18:06:16 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.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 &optional show-buffer)
24 ;; Display message NUMBER of FOLDER.
25 ;; Sets the current buffer to the show buffer.
28 (setq show-buffer mh-show-buffer))
29 ;; Bind variables in folder buffer in case they are local
30 (let ((formfile mhl-formfile)
31 (clean-message-header mh-clean-message-header)
32 (invisible-headers mh-invisible-headers)
33 (visible-headers mh-visible-headers)
34 (msg-filename (mh-msg-filename msg-num))
35 (folder mh-current-folder))
36 (if (not (file-exists-p msg-filename))
37 (error "Message %d does not exist" msg-num))
38 (switch-to-buffer show-buffer)
39 (if mh-bury-show-buffer (bury-buffer (current-buffer)))
40 (mh-when (or (not (equal msg-filename buffer-file-name)))
41 ;; Buffer does not yet contain message.
42 (clear-visited-file-modtime)
44 (setq buffer-file-name nil) ; no locking during setup
47 (if (stringp formfile)
48 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
49 "-form" formfile msg-filename)
50 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
52 (insert-file-contents msg-filename))
53 (goto-char (point-min))
54 (cond (clean-message-header
55 (mh-clean-msg-header (point-min)
58 (goto-char (point-min)))
60 (let ((case-fold-search t))
62 "^To:\\|^From:\\|^Subject:\\|^Date:" nil t)
65 (set-buffer-modified-p nil)
66 (setq buffer-file-name msg-filename)
69 (setq mode-line-buffer-identification
70 (list (format mh-show-buffer-mode-line-buffer-id
73 (fset 'mh-show-msg 'mh-show)