comparison lisp/tm/tm-edit.el @ 74:54cc21c15cbb r20-0b32

Import from CVS: tag r20-0b32
author cvs
date Mon, 13 Aug 2007 09:04:33 +0200
parents 131b0175ea99
children c0c698873ce1
comparison
equal deleted inserted replaced
73:e2d7a37b7c8d 74:54cc21c15cbb
4 4
5 ;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp> 5 ;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
6 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp> 6 ;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
7 ;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp> 7 ;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;; Created: 1994/08/21 renamed from mime.el 8 ;; Created: 1994/08/21 renamed from mime.el
9 ;; Version: $Revision: 1.1.1.1 $ 9 ;; Version: $Revision: 1.1.1.2 $
10 ;; Keywords: mail, news, MIME, multimedia, multilingual 10 ;; Keywords: mail, news, MIME, multimedia, 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
27 ;; Boston, MA 02111-1307, USA. 27 ;; Boston, MA 02111-1307, USA.
28 28
29 ;;; Commentary: 29 ;;; Commentary:
30 30
31 ;; This is an Emacs minor mode for editing Internet multimedia 31 ;; This is an Emacs minor mode for editing Internet multimedia
32 ;; messages formatted in MIME (RFC 1521 and RFC 1522). All messages in 32 ;; messages formatted in MIME (RFC 2045, 2046, 2047, 2048 and 2049).
33 ;; this mode are composed in the tagged MIME format, that are 33 ;; All messages in this mode are composed in the tagged MIME format,
34 ;; described in the following examples. The messages composed in the 34 ;; that are described in the following examples. The messages
35 ;; tagged MIME format are automatically translated into a MIME 35 ;; composed in the tagged MIME format are automatically translated
36 ;; compliant message when exiting the mode. 36 ;; into a MIME compliant message when exiting the mode.
37 37
38 ;; Mule (a multilingual extension to Emacs 18 and 19) has a capability 38 ;; Mule (a multilingual extension to Emacs 18 and 19) has a capability
39 ;; of handling multilingual text in limited ISO-2022 manner that is 39 ;; of handling multilingual text in limited ISO-2022 manner that is
40 ;; based on early experiences in Japanese Internet community and 40 ;; based on early experiences in Japanese Internet community and
41 ;; resulted in RFC 1468 (ISO-2022-JP charset for MIME). In order to 41 ;; resulted in RFC 1468 (ISO-2022-JP charset for MIME). In order to
42 ;; enable multilingual capability in single text message in MIME, 42 ;; enable multilingual capability in single text message in MIME,
43 ;; charset of multilingual text written in Mule is declared as either 43 ;; charset of multilingual text written in Mule is declared as either
44 ;; `ISO-2022-JP-2' [RFC 1554] or `ISO-2022-INT-1'. Mule is required 44 ;; `ISO-2022-JP-2' [RFC 1554] or `ISO-2022-INT-1'. Mule is required
45 ;; for reading the such messages. 45 ;; for reading the such messages.
46 46
47 ;; This MIME composer can work with Mail mode, mh-e letter Mode, and 47 ;; This MIME composer can work with Mail mode, mh-e letter Mode, and
48 ;; News mode. First of all, you need the following autoload 48 ;; News mode. First of all, you need the following autoload
49 ;; definition to load mime/editor-mode automatically: 49 ;; definition to load mime/editor-mode automatically:
94 ;; 94 ;;
95 ;;--[[text/plain]] 95 ;;--[[text/plain]]
96 ;; This is also a plain text. But, it is explicitly specified as is. 96 ;; This is also a plain text. But, it is explicitly specified as is.
97 ;; 97 ;;
98 ;;--[[text/plain; charset=ISO-2022-JP]] 98 ;;--[[text/plain; charset=ISO-2022-JP]]
99 ;; $B$3$l$O(B charset $B$r(B ISO-2022-JP $B$K;XDj$7$?F|K\8l$N(B plain $B/home/mrb/e/w/editor/lisp/tm/SCCS/s.tm-edit.el-%9%H$G$9(B. 99 ;; $B$3$l$O(B charset $B$r(B ISO-2022-JP $B$K;XDj$7$?F|K\8l$N(B plain $B%F%-%9%H$G$9(B.
100 ;; 100 ;;
101 ;;--[[text/richtext]] 101 ;;--[[text/richtext]]
102 ;; <center>This is a richtext.</center> 102 ;; <center>This is a richtext.</center>
103 ;; 103 ;;
104 ;;--[[image/gif][base64]]^M...image encoded in base64 comes here... 104 ;;--[[image/gif][base64]]^M...image encoded in base64 comes here...
108 ;;; Code: 108 ;;; Code:
109 109
110 (require 'sendmail) 110 (require 'sendmail)
111 (require 'mail-utils) 111 (require 'mail-utils)
112 (require 'mel) 112 (require 'mel)
113 (require 'tl-822)
114 (require 'tl-list) 113 (require 'tl-list)
115 (require 'tm-view) 114 (require 'tm-view)
116 (require 'tm-ew-e) 115 (require 'tm-ew-e)
117 (require 'signature) 116 (require 'signature)
118 117
119 118
120 ;;; @ version 119 ;;; @ version
121 ;;; 120 ;;;
122 121
123 (defconst mime-editor/RCS-ID 122 (defconst mime-editor/RCS-ID
124 "$Id: tm-edit.el,v 1.1.1.1 1996/12/18 22:43:37 steve Exp $") 123 "$Id: tm-edit.el,v 1.1.1.2 1996/12/21 20:50:44 steve Exp $")
125 124
126 (defconst mime-editor/version (get-version-string mime-editor/RCS-ID)) 125 (defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
127 126
128 (defconst mime-editor/version-name 127 (defconst mime-editor/version-name
129 (concat "tm-edit " mime-editor/version)) 128 (concat "tm-edit " mime-editor/version))
729 into text/plain. 728 into text/plain.
730 --[[text/plain]] 729 --[[text/plain]]
731 This is also a plain text. But, it is explicitly specified as 730 This is also a plain text. But, it is explicitly specified as
732 is. 731 is.
733 --[[text/plain; charset=ISO-2022-JP]] 732 --[[text/plain; charset=ISO-2022-JP]]
734 $B$3$l$O(B charset $B$r(B ISO-2022-JP $B$K;XDj$7$?F|K\8l$N(B plain $B/home/mrb/e/w/editor/lisp/tm/SCCS/s.tm-edit.el-%9(B 733 $B$3$l$O(B charset $B$r(B ISO-2022-JP $B$K;XDj$7$?F|K\8l$N(B plain $B%F%-%9(B
735 $B%H$G$9(B. 734 $B%H$G$9(B.
736 --[[text/richtext]] 735 --[[text/richtext]]
737 <center>This is a richtext.</center> 736 <center>This is a richtext.</center>
738 --[[image/gif][base64]]^M...image encoded in base64 here... 737 --[[image/gif][base64]]^M...image encoded in base64 here...
739 --[[audio/basic][base64]]^M...audio encoded in base64 here... 738 --[[audio/basic][base64]]^M...audio encoded in base64 here...
2477 ))) 2476 )))
2478 )) 2477 ))
2479 (t 2478 (t
2480 (let* (charset 2479 (let* (charset
2481 (pstr 2480 (pstr
2482 (mapconcat (function 2481 (let ((bytes (+ 14 (length ctype))))
2483 (lambda (attr) 2482 (mapconcat (function
2484 (if (string-equal (car attr) 2483 (lambda (attr)
2485 "charset") 2484 (if (string-equal (car attr) "charset")
2486 (progn 2485 (progn
2487 (setq charset (cdr attr)) 2486 (setq charset (cdr attr))
2488 "") 2487 "")
2489 (concat ";" (car attr) 2488 (let* ((str
2490 "=" (cdr attr)) 2489 (concat (car attr)
2491 ) 2490 "=" (cdr attr))
2492 )) 2491 )
2493 params "")) 2492 (bs (length str))
2493 )
2494 (setq bytes (+ bytes bs 2))
2495 (if (< bytes 76)
2496 (concat "; " str)
2497 (setq bytes (+ bs 1))
2498 (concat ";\n " str)
2499 )
2500 ))))
2501 params "")))
2494 encoding 2502 encoding
2495 encoded) 2503 encoded)
2496 (save-excursion 2504 (save-excursion
2497 (if (re-search-forward 2505 (if (re-search-forward
2498 "Content-Transfer-Encoding:" nil t) 2506 "Content-Transfer-Encoding:" nil t)