comparison lisp/tm/tm-mh-e.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 56c54cf7c5b6
children 54cc21c15cbb
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
4 4
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> 5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6 ;; OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp> 6 ;; OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
7 ;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp> 7 ;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;; Created: 1993/11/21 (obsolete mh-e-mime.el) 8 ;; Created: 1993/11/21 (obsolete mh-e-mime.el)
9 ;; Version: $Revision: 1.3 $ 9 ;; Version: $Revision: 1.1.1.1 $
10 ;; Keywords: mail, MH, MIME, multimedia, encoded-word, multilingual 10 ;; Keywords: mail, MH, MIME, multimedia, encoded-word, multilingual
11 11
12 ;; This file is part of tm (Tools for MIME). 12 ;; This file is part of tm (Tools for MIME).
13 13
14 ;; This program is free software; you can redistribute it and/or 14 ;; This program is free software; you can redistribute it and/or
46 46
47 ;;; @ version 47 ;;; @ version
48 ;;; 48 ;;;
49 49
50 (defconst tm-mh-e/RCS-ID 50 (defconst tm-mh-e/RCS-ID
51 "$Id: tm-mh-e.el,v 1.3 1997/08/21 06:24:13 steve Exp $") 51 "$Id: tm-mh-e.el,v 1.1.1.1 1996/12/18 22:43:38 steve Exp $")
52 52
53 (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID)) 53 (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID))
54 54
55 55
56 ;;; @ variable 56 ;;; @ variable
71 (setq mode tm-mh-e/automatic-mime-preview) 71 (setq mode tm-mh-e/automatic-mime-preview)
72 ) 72 )
73 ;; Display message NUMBER of FOLDER. 73 ;; Display message NUMBER of FOLDER.
74 ;; Sets the current buffer to the show buffer. 74 ;; Sets the current buffer to the show buffer.
75 (set-buffer folder) 75 (set-buffer folder)
76 (or show-buffer
77 (setq show-buffer mh-show-buffer))
76 ;; Bind variables in folder buffer in case they are local 78 ;; Bind variables in folder buffer in case they are local
77 (let ((formfile mhl-formfile) 79 (let ((msg-filename (mh-msg-filename msg-num)))
78 (clean-message-header mh-clean-message-header)
79 (invisible-headers mh-invisible-headers)
80 (visible-headers mh-visible-headers)
81 (msg-filename (mh-msg-filename msg-num))
82 (show-buffer mh-show-buffer)
83 )
84 (if (not (file-exists-p msg-filename)) 80 (if (not (file-exists-p msg-filename))
85 (error "Message %d does not exist" msg-num)) 81 (error "Message %d does not exist" msg-num))
86 (set-buffer show-buffer) 82 (set-buffer show-buffer)
87 (cond ((not (equal msg-filename buffer-file-name)) 83 (cond ((not (equal msg-filename buffer-file-name))
88 ;; Buffer does not yet contain message. 84 ;; Buffer does not yet contain message.
89 (mh-unvisit-file) 85 (clear-visited-file-modtime)
86 (unlock-buffer)
87 (setq buffer-file-name nil) ; no locking during setup
90 (setq buffer-read-only nil) 88 (setq buffer-read-only nil)
91 (erase-buffer) 89 (erase-buffer)
92 ;; Changing contents, so this hook needs to be reinitialized.
93 ;; pgp.el uses this.
94 (if (boundp 'write-contents-hooks) ;Emacs 19
95 (setq write-contents-hooks nil))
96 (if mode 90 (if mode
97 (let* ((aname (concat "article-" folder)) 91 (let* ((aname (concat "article-" folder))
98 (abuf (get-buffer aname)) 92 (abuf (get-buffer aname))
99 ) 93 )
100 (if abuf 94 (if abuf
118 (setq buffer-file-name msg-filename) 112 (setq buffer-file-name msg-filename)
119 (mh-show-mode) 113 (mh-show-mode)
120 (mime/viewer-mode nil nil nil 114 (mime/viewer-mode nil nil nil
121 aname (concat "show-" folder)) 115 aname (concat "show-" folder))
122 (goto-char (point-min)) 116 (goto-char (point-min))
123 (let ( (buffer-read-only nil) )
124 (cond (clean-message-header
125 (mh-clean-msg-header (point-min)
126 invisible-headers
127 visible-headers)
128 (goto-char (point-min)))
129 (t
130 (mh-start-of-uncleaned-message))))
131 (goto-char (point-min))
132 ) 117 )
133 (progn 118 (let ((clean-message-header mh-clean-message-header)
134 (if formfile 119 (invisible-headers mh-invisible-headers)
120 (visible-headers mh-visible-headers)
121 )
122 ;; 1995/9/21
123 ;; modified by ARIURA <ariura@cc.tuat.ac.jp>
124 ;; to support mhl.
125 (if mhl-formfile
135 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" 126 (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
136 (if (stringp formfile) 127 (if (stringp mhl-formfile)
137 (list "-form" formfile)) 128 (list "-form" mhl-formfile))
138 msg-filename) 129 msg-filename)
139 (insert-file-contents msg-filename)) 130 (insert-file-contents msg-filename))
140 ;; end 131 ;; end
141 (goto-char (point-min)) 132 (goto-char (point-min))
142 (cond (clean-message-header 133 (cond (clean-message-header
152 (set-buffer-modified-p nil) 143 (set-buffer-modified-p nil)
153 (setq buffer-read-only t) 144 (setq buffer-read-only t)
154 (setq buffer-file-name msg-filename) 145 (setq buffer-file-name msg-filename)
155 (mh-show-mode) 146 (mh-show-mode)
156 )) 147 ))
157 (set-buffer-modified-p nil)
158 (or (eq buffer-undo-list t) ;don't save undo info for prev msgs 148 (or (eq buffer-undo-list t) ;don't save undo info for prev msgs
159 (setq buffer-undo-list nil)) 149 (setq buffer-undo-list nil))
160 (set-buffer-auto-saved) 150 ;;; Added by itokon (02/19/96)
161 ;; the parts of set-visited-file-name we want to do (no locking)
162 (setq buffer-file-name msg-filename) 151 (setq buffer-file-name msg-filename)
163 (setq buffer-backed-up nil) 152 ;;;
164 (auto-save-mode 1)
165 (set-mark nil) 153 (set-mark nil)
166 (setq mode-line-buffer-identification 154 (setq mode-line-buffer-identification
167 (list (format mh-show-buffer-mode-line-buffer-id 155 (list (format mh-show-buffer-mode-line-buffer-id
168 folder msg-num))) 156 folder msg-num)))
169 (set-buffer folder) 157 (set-buffer folder)
224 (let (tm-mh-e/automatic-mime-preview 212 (let (tm-mh-e/automatic-mime-preview
225 tm-mh-e/decode-encoded-word) 213 tm-mh-e/decode-encoded-word)
226 (mh-header-display) 214 (mh-header-display)
227 )) 215 ))
228 216
217 (defun tm-mh-e/scroll-up-msg (&optional arg)
218 (interactive)
219 (mh-page-msg (or arg 1))
220 )
221
222 (defun tm-mh-e/scroll-down-msg (&optional arg)
223 (interactive)
224 (mh-page-msg (- (or arg 1)))
225 )
226
229 (defun tm-mh-e/burst-multipart/digest () 227 (defun tm-mh-e/burst-multipart/digest ()
230 "Burst apart the current message, which should be a multipart/digest. 228 "Burst apart the current message, which should be a multipart/digest.
231 The message is replaced by its table of contents and the letters from the 229 The message is replaced by its table of contents and the letters from the
232 digest are inserted into the folder after that message." 230 digest are inserted into the folder after that message."
233 (interactive) 231 (interactive)
291 (save-excursion 289 (save-excursion
292 (set-buffer buf) 290 (set-buffer buf)
293 (goto-char (point-max)) 291 (goto-char (point-max))
294 (setq mh-show-buffer buf) 292 (setq mh-show-buffer buf)
295 (apply (function mh-send) 293 (apply (function mh-send)
296 (std11-field-bodies '("From" "cc" "Subject") "")) 294 (std11-field-bodies '("To" "cc" "Subject") ""))
297 (setq mh-sent-from-folder buf) 295 (setq mh-sent-from-folder buf)
298 (setq mh-sent-from-msg 1) 296 (setq mh-sent-from-msg 1)
299 (let ((last (point))) 297 (let ((last (point)))
300 (mh-yank-cur-msg) 298 (mh-yank-cur-msg)
301 (goto-char last) 299 (goto-char last)
340 (define-key mh-folder-mode-map "v" (function tm-mh-e/view-message)) 338 (define-key mh-folder-mode-map "v" (function tm-mh-e/view-message))
341 (define-key mh-folder-mode-map "\et" (function tm-mh-e/toggle-decoding-mode)) 339 (define-key mh-folder-mode-map "\et" (function tm-mh-e/toggle-decoding-mode))
342 (define-key mh-folder-mode-map "." (function tm-mh-e/show)) 340 (define-key mh-folder-mode-map "." (function tm-mh-e/show))
343 (define-key mh-folder-mode-map "," (function tm-mh-e/header-display)) 341 (define-key mh-folder-mode-map "," (function tm-mh-e/header-display))
344 (define-key mh-folder-mode-map "\e," (function tm-mh-e/raw-display)) 342 (define-key mh-folder-mode-map "\e," (function tm-mh-e/raw-display))
343 (define-key mh-folder-mode-map "\r" (function tm-mh-e/scroll-up-msg))
344 (define-key mh-folder-mode-map "\e\r" (function tm-mh-e/scroll-down-msg))
345 (define-key mh-folder-mode-map "\C-c\C-b" 345 (define-key mh-folder-mode-map "\C-c\C-b"
346 (function tm-mh-e/burst-multipart/digest)) 346 (function tm-mh-e/burst-multipart/digest))
347 347
348 (defun tm-mh-e/summary-before-quit () 348 (defun tm-mh-e/summary-before-quit ()
349 (let ((buf (get-buffer mh-show-buffer))) 349 (let ((buf (get-buffer mh-show-buffer)))