--- /dev/null
+* mel
+
+ Attached version 1.8.
+
+** mel/mel-q.el
+----------------------------
+revision 1.8
+date: 1995/08/27 19:29:17; author: morioka; state: Exp; lines: +3 -2
+Fixed problem of function `quoted-printable-internal-decode-region' in
+Mule.
+----------------------------
+revision 1.7
+date: 1995/08/27 17:45:52; author: morioka; state: Exp; lines: +2 -2
+Fixed (provide 'qprint) to (provide 'mel-q).
+----------------------------
+revision 1.6
+date: 1995/08/27 17:06:53; author: morioka; state: Exp; lines: +5 -6
+(1) Fixed function `q-encoding-encode-string-for-phrase' to encode
+ space to `_'.
+(2) Fixed function `q-encoding-encode-string' to call function
+ `q-encoding-encode-string-for-phrase' in default mode.
+----------------------------
+
+* tm
+
+** tm/tiny-mime.el
+----------------------------
+revision 6.2
+date: 1995/08/27 19:05:07; author: morioka; state: Exp; lines: +3 -2
+Defined constant `mime/tspecials', constant `mime/token-regexp' is
+defined by it.
+----------------------------
+revision 6.1
+date: 1995/08/27 17:42:42; author: morioka; state: Exp; lines: +1 -2
+Eliminated (require 'tl-num).
+----------------------------
+revision 6.0
+date: 1995/08/27 17:22:36; author: morioka; state: Exp; lines: +10 -10
+Eliminated unnecessary condition in function `mime/encode-string'.
+----------------------------
+revision 5.22
+date: 1995/08/27 17:17:38; author: morioka; state: Exp; lines: +15 -175
+Use mel to encode.
+----------------------------
+revision 5.21
+date: 1995/08/27 14:22:54; author: morioka; state: Exp; lines: +4 -3
+Fixed problem of constant `mime/charset-regexp'.
+----------------------------
+revision 5.20
+date: 1995/08/27 13:35:27; author: morioka; state: Exp; lines: +25 -8
+(1) Function `mime/decode-encoded-text' was moved from
+ tm-{nemacs,orig,mule}.el.
+(2) Use mel in function `mime/decode-encoded-text'.
+----------------------------
+revision 5.19
+date: 1995/08/26 23:11:06; author: morioka; state: Exp; lines: +2 -2
+In function `mime/decode-encoded-word', encoding is regulated to upper
+case.
+----------------------------
+
+** tm/tm-comp.el
+----------------------------
+revision 6.8
+date: 1995/08/30 00:40:26; author: morioka; state: Exp; lines: +8 -80
+(1) Moved GNUS 4.* setting to tm-gnus4.el.
+(2) Value part of variable `mime/message-after-send-hook-alist' does not
+ quote.
+----------------------------
+
+** tm/tm-mule.el
+----------------------------
+revision 6.4
+date: 1995/08/27 13:33:13; author: morioka; state: Exp; lines: +6 -13
+Moved function `mime/decode-encoded-text' to tiny-mime.el.
+----------------------------
+
+** tm/tm-nemacs.el
+----------------------------
+revision 6.3
+date: 1995/08/27 14:24:22; author: morioka; state: Exp; lines: +12 -18
+(1) Use string= if possible.
+(2) Use constants if possible.
+----------------------------
+revision 6.2
+date: 1995/08/27 13:31:02; author: morioka; state: Exp; lines: +11 -20
+Moved function `mime/decode-encoded-text' to tiny-mime.el.
+----------------------------
+
+** tm/tm-orig.el
+----------------------------
+revision 6.3
+date: 1995/08/27 14:26:18; author: morioka; state: Exp; lines: +13 -17
+Use string= if possible.
+----------------------------
+revision 6.2
+date: 1995/08/27 13:32:02; author: morioka; state: Exp; lines: +1 -14
+Moved function `mime/decode-encoded-text' to tiny-mime.el.
+----------------------------
+
+** tm/tm-view.el
+----------------------------
+revision 6.74
+date: 1995/08/27 19:05:58; author: morioka; state: Exp; lines: +1 -4
+Use definition of constant `mime/token-regexp' in tiny-mime.el.
+----------------------------
+
+
+* tm/gnus
+
+ Attached version 6.16.
+
+** tm/gnus/tm-gnus4.el
+----------------------------
+revision 6.1
+date: 1995/08/30 00:41:17; author: morioka; state: Exp; lines: +98 -1
+Added setting for tm-comp.
+----------------------------
+
+** tm/gnus/tm-dgnus.el
+----------------------------
+revision 6.16
+date: 1995/08/30 02:44:11; author: morioka; state: Exp; lines: +14 -1
+Added setting for tm-comp.
+----------------------------
--- /dev/null
+* mel
+
+ Version 1.8 \e$B$rE:IU$7$?!#\e(B
+
+** mel/mel-q.el
+----------------------------
+revision 1.8
+date: 1995/08/27 19:29:17; author: morioka; state: Exp; lines: +3 -2
+\e$B4X?t\e(B quoted-printable-internal-decode-region \e$B$N\e(B Mule \e$B$K$*$1$kIT6q9g$r\e(B
+\e$B=$@5$7$?!#\e(B
+----------------------------
+revision 1.7
+date: 1995/08/27 17:45:52; author: morioka; state: Exp; lines: +2 -2
+(provide 'qprint) \e$B$r\e(B (provide 'mel-q) \e$B$KD>$7$?!#\e(B
+----------------------------
+revision 1.6
+date: 1995/08/27 17:06:53; author: morioka; state: Exp; lines: +5 -6
+(1) \e$B6uGr$r\e(B `_' \e$B$K\e(B encode \e$B$9$k$h$&$K4X?t\e(B
+ q-encoding-encode-string-for-phrase \e$B$r=$@5$7$?!#\e(B
+(2) default \e$B$N>l9g!"4X?t\e(B q-encoding-encode-string-for-phrase \e$B$r8F$V$h\e(B
+ \e$B$&$K!"4X?t\e(B q-encoding-encode-string \e$B$r=$@5$7$?!#\e(B
+----------------------------
+
+
+* tm
+
+** tm/tiny-mime.el
+----------------------------
+revision 6.2
+date: 1995/08/27 19:05:07; author: morioka; state: Exp; lines: +3 -2
+\e$BDj?t\e(B mime/tspecials \e$B$rDj5A$7!"$3$l$rMQ$$$FDj?t\e(B mime/token-regexp \e$B$rDj\e(B
+\e$B5A$9$k$h$&$K$7$?!#\e(B
+----------------------------
+revision 6.1
+date: 1995/08/27 17:42:42; author: morioka; state: Exp; lines: +1 -2
+(require 'tl-num) \e$B$r=|5n$7$?!#\e(B
+----------------------------
+revision 6.0
+date: 1995/08/27 17:22:36; author: morioka; state: Exp; lines: +10 -10
+\e$B4X?t\e(B mime/encode-string \e$B$K$*$$$FITMW$J>r7o$r=|5n$7$?!#\e(B
+----------------------------
+revision 5.22
+date: 1995/08/27 17:17:38; author: morioka; state: Exp; lines: +15 -175
+encode \e$B$K$b\e(B mel \e$B$r;H$&$h$&$K$7$?!#\e(B
+----------------------------
+revision 5.21
+date: 1995/08/27 14:22:54; author: morioka; state: Exp; lines: +4 -3
+\e$BDj?t\e(B mime/charset-regexp \e$B$NIT6q9g$r=$@5$7$?!#\e(B
+----------------------------
+revision 5.20
+date: 1995/08/27 13:35:27; author: morioka; state: Exp; lines: +25 -8
+(1) \e$B4X?t\e(B mime/decode-encoded-text \e$B$r\e(B tm-{nemacs,orig,mule}.el \e$B$+$i0\$7\e(B
+ \e$B$?!#\e(B
+(2) \e$B4X?t\e(B mime/decode-encoded-text \e$B$G\e(B mel \e$B$r;H$&$h$&$K$7$?!#\e(B
+----------------------------
+revision 5.19
+date: 1995/08/26 23:11:06; author: morioka; state: Exp; lines: +2 -2
+\e$B4X?t\e(B mime/decode-encoded-word \e$B$K$*$$$F!"\e(Bencoding \e$B$rBgJ8;z$K@55,2=$9$k\e(B
+\e$B$h$&$K$7$?!#\e(B
+----------------------------
+
+** tm/tm-comp.el
+----------------------------
+revision 6.8
+date: 1995/08/30 00:40:26; author: morioka; state: Exp; lines: +8 -80
+(1) GNUS 4.* \e$BMQ$N@_Dj$r\e(B tm-gnus4.el \e$B$K0\$7$?!#\e(B
+(2) \e$BJQ?t\e(B mime/message-after-send-hook-alist \e$B$NCMIt$r\e(B quote \e$B$7$J$$$h$&\e(B
+ \e$B$K$7$?!#\e(B
+----------------------------
+
+** tm/tm-mule.el
+----------------------------
+revision 6.4
+date: 1995/08/27 13:33:13; author: morioka; state: Exp; lines: +6 -13
+\e$B4X?t\e(B mime/decode-encoded-text \e$B$r\e(B tiny-mime.el \e$B$K0\$7$?!#\e(B
+----------------------------
+
+** tm/tm-nemacs.el
+----------------------------
+revision 6.3
+date: 1995/08/27 14:24:22; author: morioka; state: Exp; lines: +12 -18
+(1) \e$B$G$-$k$@$1\e(B string= \e$B$r;H$&$h$&$K$7$?!#\e(B
+(2) \e$B$G$-$k$@$1Dj?t$rMQ$$$k$h$&$K$7$?!#\e(B
+----------------------------
+revision 6.2
+date: 1995/08/27 13:31:02; author: morioka; state: Exp; lines: +11 -20
+\e$B4X?t\e(B mime/decode-encoded-text \e$B$r\e(B tiny-mime.el \e$B$K0\$7$?!#\e(B
+----------------------------
+
+** tm/tm-orig.el
+----------------------------
+revision 6.3
+date: 1995/08/27 14:26:18; author: morioka; state: Exp; lines: +13 -17
+\e$B$G$-$k$@$1\e(B string= \e$B$r;H$&$h$&$K$7$?!#\e(B
+----------------------------
+revision 6.2
+date: 1995/08/27 13:32:02; author: morioka; state: Exp; lines: +1 -14
+\e$B4X?t\e(B mime/decode-encoded-text \e$B$r\e(B tiny-mime.el \e$B$K0\$7$?!#\e(B
+----------------------------
+
+** tm/tm-view.el
+----------------------------
+revision 6.74
+date: 1995/08/27 19:05:58; author: morioka; state: Exp; lines: +1 -4
+\e$BDj?t\e(B mime/token-regexp \e$B$O\e(B tiny-mime.el \e$B$NDj5A$rMQ$$$k$h$&$K$7$?!#\e(B
+----------------------------
+
+
+* tm/gnus
+
+ Version 6.16 \e$B$rE:IU$7$?!#\e(B
+
+** tm/gnus/tm-gnus4.el
+----------------------------
+revision 6.1
+date: 1995/08/30 00:41:17; author: morioka; state: Exp; lines: +98 -1
+tm-comp \e$BMQ$N@_Dj$rDI2C$7$?!#\e(B
+----------------------------
+
+** tm/gnus/tm-dgnus.el
+----------------------------
+revision 6.16
+date: 1995/08/30 02:44:11; author: morioka; state: Exp; lines: +14 -1
+tm-comp \e$BMQ$N@_Dj$rDI2C$7$?!#\e(B
+----------------------------
FILES = $(TM_FILES) $(TM_MUA_FILES) $(MEL_FILES) $(TL_FILES)
-TARFILE = tm6.73.tar
+TARFILE = tm6.74.tar
nemacs:
FILES = tm/gnus/*.el
-TARFILE = tm-gnus6.3.tar
+TARFILE = tm-gnus6.16.tar
gnus3:
;;; @ version
;;;
(defconst tm-gnus/RCS-ID
- "$Id: tm-dgnus.el,v 6.15 1995/08/25 14:08:02 morioka Exp $")
+ "$Id: tm-dgnus.el,v 6.16 1995/08/30 02:44:11 morioka Exp $")
(defconst tm-gnus/version
(concat (get-version-string tm-gnus/RCS-ID) " (ding)"))
)
+;;; @ for tm-comp
+;;;
+
+(call-after-loaded
+ 'tm-comp
+ (function
+ (lambda ()
+ (set-alist 'mime/message-sender-alist
+ 'news-reply-mode
+ (function gnus-inews-news))
+ )))
+
+
;;; @ end
;;;
;;;
-;;; $Id: tm-gnus4.el,v 6.0 1995/06/19 21:33:39 morioka Exp $
+;;; $Id: tm-gnus4.el,v 6.1 1995/08/30 00:41:17 morioka Exp $
;;;
(require 'tm-ognus)
(add-hook 'gnus-article-prepare-hook
(function mime/decode-message-header-if-you-need) t)
+
+;;; @ for tm-comp
+;;;
+
+(defun tm-gnus4/message-before-send ()
+ (let ((case-fold-search nil))
+ (or (boundp 'mime/news-reply-mode-server-running)
+ (make-variable-buffer-local 'mime/news-reply-mode-server-running))
+ (setq mime/news-reply-mode-server-running (gnus-server-opened))
+ (save-excursion
+ (gnus-start-news-server)
+ (widen)
+ (goto-char (point-min))
+ (run-hooks 'news-inews-hook)
+ (save-restriction
+ (narrow-to-region
+ (point-min)
+ (progn
+ (goto-char (point-min))
+ (search-forward (concat "\n" mail-header-separator "\n"))
+ (point)))
+
+ (goto-char (point-min))
+ (if (search-forward-regexp "^Newsgroups: +" nil t)
+ (save-restriction
+ (narrow-to-region
+ (point)
+ (if (re-search-forward "^[^ \t]" nil 'end)
+ (match-beginning 0)
+ (point-max)))
+ (goto-char (point-min))
+ (replace-regexp "\n[ \t]+" " ")
+ (goto-char (point-min))
+ (replace-regexp "[ \t\n]*,[ \t\n]*\\|[ \t]+" ",")
+ ))
+ ))))
+
+(defun tm-gnus4/message-sender ()
+ (interactive)
+ (widen)
+ (goto-char (point-min))
+ (save-restriction
+ (narrow-to-region
+ (point-min)
+ (progn
+ (goto-char (point-min))
+ (search-forward (concat "\n" mail-header-separator "\n"))
+ (point)))
+ ;; Mail the message too if To: or Cc: exists.
+ (if (or (mail-fetch-field "to" nil t)
+ (mail-fetch-field "cc" nil t))
+ (if gnus-mail-send-method
+ (progn
+ (message
+ (format "Sending (%d/%d) via mail..." (+ i 1) total))
+ (widen)
+ (funcall gnus-mail-send-method)
+ (message
+ (format "Sending (%d/%d) via mail... done" (+ i 1) total))
+ (ding)
+ (message
+ "No mailer defined. To: and/or Cc: fields ignored.")
+ (sit-for 1)))))
+ (message
+ (format "Posting %d/%d to USENET..." (+ i 1) total))
+ (if (gnus-inews-article)
+ (message
+ (format "Posting %d/%d to USENET... done" (+ i 1) total))
+ ;; We cannot signal an error.
+ (ding)
+ (message
+ (format "Article %d/%d rejected: %s"
+ (+ i 1) total (gnus-status-message)))
+ (sit-for 3))
+ )
+
+(defun tm-gnus4/message-after-send ()
+ (or mime/news-reply-mode-server-running
+ (gnus-close-server))
+ (and (fboundp 'bury-buffer) (bury-buffer))
+ )
+
+(call-after-loaded
+ 'tm-comp
+ (function
+ (lambda ()
+ (set-alist 'mime/message-before-send-hook-alist
+ 'news-reply-mode
+ (function tm-gnus4/message-before-send))
+ (set-alist 'mime/message-sender-alist
+ 'news-reply-mode
+ (function tm-gnus4/message-sender))
+ (set-alist 'mime/message-after-send-hook-alist
+ 'news-reply-mode
+ (function tm-gnus4/message-after-send))
+ )))
+
(provide 'tm-gnus4)
;;; mime.el,v 1.5 1992/07/18 07:52:08 by Enami Tsugutomo
;;;
+
;;; @ require modules
;;;
+
(require 'emu)
+(require 'mel)
(require 'tl-header)
(require 'tl-str)
-(require 'tl-num)
;;; @ version
;;;
+
(defconst mime/RCS-ID
- "$Id: tiny-mime.el,v 5.18 1995/08/26 18:38:37 morioka Exp $")
+ "$Id: tiny-mime.el,v 6.2 1995/08/27 19:05:07 morioka Exp $")
(defconst mime/tiny-mime-version (get-version-string mime/RCS-ID))
;;; @ MIME encoded-word definition
;;;
-(defconst mime/charset-regexp "[A-Za-z0-9!#$%&'*+---^_`{}|~]")
+(defconst mime/tspecials "][\000-\040()<>@,\;:\\\"/?.=")
+(defconst mime/token-regexp (concat "[^" mime/tspecials "]+"))
+(defconst mime/charset-regexp mime/token-regexp)
(defconst mime/encoded-text-regexp "[!->@-~]+")
(defconst mime/Base64-token-regexp "[A-Za-z0-9+/=]")
(defconst mime/encoded-word-regexp (concat (regexp-quote "=?")
"\\("
mime/charset-regexp
- "+\\)"
+ "\\)"
(regexp-quote "?")
"\\(B\\|Q\\)"
(regexp-quote "?")
;;; @ compatible module among Mule, NEmacs and NEpoch
;;;
+
(cond ((boundp 'MULE) (require 'tm-mule))
((boundp 'NEMACS)(require 'tm-nemacs))
(t (require 'tm-orig))
;;; @@ MIME header decoders
;;;
-;; by mol. 1993/10/4
+(defun mime/decode-encoded-text (charset encoding str)
+ (let ((dest
+ (cond ((string= "B" encoding)
+ (base64-decode-string str))
+ ((string= "Q" encoding)
+ (q-encoding-decode-string str))
+ (t (message "unknown encoding %s" encoding)
+ nil))))
+ (if dest
+ (mime/convert-string-to-emacs charset dest)
+ )))
+
(defun mime/decode-encoded-word (word)
- (if (string-match mime/encoded-word-regexp word)
- (let ((charset (upcase (mime/encoded-word-charset word)))
- (encoding (mime/encoded-word-encoding word))
- (text (mime/encoded-word-encoded-text word)))
- (mime/decode-encoded-text charset encoding text))
- word))
+ (or (if (string-match mime/encoded-word-regexp word)
+ (let ((charset (upcase (mime/encoded-word-charset word)))
+ (encoding (upcase (mime/encoded-word-encoding word)))
+ (text (mime/encoded-word-encoded-text word)))
+ (mime/decode-encoded-text charset encoding text)
+ ))
+ word))
(defun mime/decode-region (beg end)
(interactive "*r")
)
)
(setq end (match-end 0))
- (setq dest (concat dest (mime/decode-encoded-word (substring str beg end))
+ (setq dest (concat dest
+ (mime/decode-encoded-word (substring str beg end))
))
(setq str (substring str end))
(setq ew t)
;;;
(defun mime/encode-string (string encoding &optional mode)
- (cond ((equal encoding "B") (mime/base64-encode-string string))
- ((equal encoding "Q") (mime/Quoted-Printable-encode-string string mode))
- (t nil)
+ (cond ((string= encoding "B") (base64-encode-string string))
+ ((string= encoding "Q") (q-encoding-encode-string string mode))
))
(defun mime/encode-field (str)
(narrow-to-region (goto-char (point-min))
(progn
(re-search-forward
- (concat "^" (regexp-quote mail-header-separator) "$")
+ (concat
+ "^" (regexp-quote mail-header-separator) "$")
nil t)
(match-beginning 0)
))
(progn
(goto-char (point-min))
(if (re-search-forward "^Subject:.*\\(\n\\s +.*\\)*" nil t)
- (let ((str (buffer-substring (match-beginning 0)(match-end 0))))
+ (let ((str (buffer-substring (match-beginning 0)
+ (match-end 0))))
(if (string-match mime/encoded-word-regexp str)
(insert (concat
"\nX-Nsubject: "
)))
)))
-;;; @ Base64 (B-encode) decoder/encoder
-;;; by Enami Tsugutomo
-;;; modified by mol.
-
-(defun mime/base64-decode-string (string)
- (mime/base64-mapconcat (function mime/base64-decode-chars) 4 string))
-
-;; (mime/base64-encode-string (mime/base64-decode-string "GyRAOjRGI0stGyhK"))
-(defun mime/base64-encode-string (string &optional mode)
- (let ((es (mime/base64-mapconcat (function mime/base64-encode-chars) 3 string))
- m)
- (setq m (mod (length es) 4))
- (concat es
- (cond ((= m 3) "=")
- ((= m 2) "==")
- ))
- ))
-
-;; (char-to-string (mime/base64-bit-to-char 26))
-(defun mime/base64-bit-to-char (n)
- (cond ((eq n nil) ?=)
- ((< n 26) (+ ?A n))
- ((< n 52) (+ ?a (- n 26)))
- ((< n 62) (+ ?0 (- n 52)))
- ((= n 62) ?+)
- ((= n 63) ?/)
- (t (error "not a base64 integer %d" n))))
-
-(defun mime/base64-char-to-bit (c)
- (cond ((and (<= ?A c) (<= c ?Z)) (- c ?A))
- ((and (<= ?a c) (<= c ?z)) (+ (- c ?a) 26))
- ((and (<= ?0 c) (<= c ?9)) (+ (- c ?0) 52))
- ((= c ?+) 62)
- ((= c ?/) 63)
- ((= c ?=) nil)
- (t (error "not a base64 character %c" c))))
-
-(defun mime/mask (i n) (logand i (1- (ash 1 n))))
-
-(defun mime/base64-encode-1 (a &optional b &optional c)
- (cons (ash a -2)
- (cons (logior (ash (mime/mask a 2) (- 6 2))
- (if b (ash b -4) 0))
- (if b
- (cons (logior (ash (mime/mask b 4) (- 6 4))
- (if c (ash c -6) 0))
- (if c
- (cons (mime/mask c (- 6 0))
- nil)))))))
-
-(defun mime/base64-decode-1 (a b &optional c &optional d)
- (cons (logior (ash a 2) (ash b (- 2 6)))
- (if c (cons (logior (ash (mime/mask b 4) 4)
- (mime/mask (ash c (- 4 6)) 4))
- (if d (cons (logior (ash (mime/mask c 2) 6) d)
- nil))))))
-
-;; (mime/base64-decode-chars ?G ?y ?R ?A)
-(defun mime/base64-decode-chars (a b c d)
- (apply (function mime/base64-decode-1)
- (mapcar (function mime/base64-char-to-bit)
- (list a b c d))))
-
-;; (mapcar (function char-to-string) (mime/base64-encode-chars 27 36 64))
-(defun mime/base64-encode-chars (a b c)
- (mapcar (function mime/base64-bit-to-char) (mime/base64-encode-1 a b c)))
-
-(defun mime/base64-fecth-from (func from pos len)
- (let (ret)
- (while (< 0 len)
- (setq len (1- len)
- ret (cons (funcall func from (+ pos len)) ret)))
- ret))
-
-(defun mime/base64-fecth-from-buffer (from pos len)
- (mime/base64-fecth-from (function (lambda (f p) (char-after p)))
- from pos len))
-
-(defun mime/base64-fecth-from-string (from pos len)
- (mime/base64-fecth-from (function (lambda (f p)
- (if (< p (length f)) (aref f p))))
- from pos len))
-
-(defun mime/base64-fecth (source pos len)
- (cond ((stringp source) (mime/base64-fecth-from-string source pos len))
- (t (mime/base64-fecth-from-buffer source pos len))))
-
-(defun mime/base64-mapconcat (func unit string)
- (let ((i 0) ret)
- (while (< i (length string))
- (setq ret
- (apply (function concat)
- ret
- (mapcar (function char-to-string)
- (apply func (mime/base64-fecth string i unit)))))
- (setq i (+ i unit)))
- ret))
-
-;;; @ Quoted-Printable (Q-encode) encoder/decoder
-;;;
-
-(defun mime/Quoted-Printable-decode-string (str)
- (let ((dest "")
- (len (length str))
- (i 0) chr num h l)
- (while (< i len)
- (setq chr (elt str i))
- (cond ((eq chr ?=)
- (if (< (+ i 2) len)
- (progn
- (setq h (hex-char-to-number (elt str (+ i 1))))
- (setq l (hex-char-to-number (elt str (+ i 2))))
- (setq num (+ (* h 16) l))
- (setq dest (concat dest (char-to-string num)))
- (setq i (+ i 3))
- )
- (progn
- (setq dest (concat dest (char-to-string chr)))
- (setq i (+ i 1))
- )))
- ((eq chr ?_)
- (setq dest (concat dest (char-to-string 32)))
- (setq i (+ i 1))
- )
- (t
- (setq dest (concat dest (char-to-string chr)))
- (setq i (+ i 1))
- ))
- )
- dest))
-
-(defun mime/Quoted-Printable-encode-string (str &optional mode)
- (if (null mode)
- (setq mode 'phrase))
- (let ((dest "")
- (len (length str))
- (i 0) chr)
- (while (< i len)
- (setq chr (elt str i))
- (cond ((eq chr 32)
- (setq dest (concat dest "_"))
- )
- ((or (eq chr ?=)
- (eq chr ??)
- (eq chr ?_)
- (and (eq mode 'comment)
- (or (eq chr ?\()
- (eq chr ?\))
- (eq chr ?\\)
- ))
- (and (eq mode 'phrase)
- (not (string-match "[A-Za-z0-9!*+/=_---]"
- (char-to-string chr)))
- )
- (< chr 32)
- (> chr 126))
- (setq dest (concat dest
- "="
- (char-to-string (number-to-hex-char (/ chr 16)))
- (char-to-string (number-to-hex-char (% chr 16)))
- ))
- )
- (t (setq dest (concat dest (char-to-string chr)))
- ))
- (setq i (+ i 1))
- )
- dest))
;;; @ functions for message header encoding
;;;
(while (and (< i len)
(setq js (mime/convert-string-from-emacs
(substring string 0 i) charset))
- (setq m (+ n (mime/encoded-word-length js encoding) cesl))
+ (setq m (+ n
+ (mime/encoded-word-length js encoding)
+ cesl))
(< m 76))
(setq j i)
(setq i (+ i (char-bytes (elt string i))))
(defun mime/encode-header-word (n string charset encoding)
(let (dest str ret m)
- (if (null (setq ret (mime/encode-and-split-string n string charset encoding)))
+ (if (null (setq ret
+ (mime/encode-and-split-string n string charset encoding)))
nil
(progn
(setq dest (nth 1 ret))
(setq m (car ret))
(setq str (nth 2 ret))
(while (and (stringp str)
- (setq ret (mime/encode-and-split-string 1 str charset encoding))
+ (setq ret
+ (mime/encode-and-split-string
+ 1 str charset encoding))
)
(setq dest (concat dest "\n " (nth 1 ret)))
(setq m (car ret))
;;;
(defconst mime/composer-RCS-ID
- "$Id: tm-comp.el,v 6.7 1995/06/12 05:33:22 morioka Exp $")
+ "$Id: tm-comp.el,v 6.8 1995/08/30 00:40:26 morioka Exp $")
(defconst mime/composer-version (get-version-string mime/composer-RCS-ID))
(message
(format "Sending %d/%d... done" (+ i 1) total))
))
- (news-reply-mode . (lambda ()
- (interactive)
- (widen)
- (goto-char (point-min))
- (save-restriction
- (narrow-to-region
- (point-min)
- (progn
- (goto-char (point-min))
- (search-forward (concat "\n" mail-header-separator "\n"))
- (point)))
- ;; Mail the message too if To: or Cc: exists.
- (if (or (mail-fetch-field "to" nil t)
- (mail-fetch-field "cc" nil t))
- (if gnus-mail-send-method
- (progn
- (message
- (format "Sending (%d/%d) via mail..." (+ i 1) total))
- (widen)
- (funcall gnus-mail-send-method)
- (message
- (format "Sending (%d/%d) via mail... done" (+ i 1) total))
- (ding)
- (message "No mailer defined. To: and/or Cc: fields ignored.")
- (sit-for 1)))))
- (message
- (format "Posting %d/%d to USENET..." (+ i 1) total))
- (if (gnus-inews-article)
- (message
- (format "Posting %d/%d to USENET... done" (+ i 1) total))
- ;; We cannot signal an error.
- (ding)
- (message
- (format "Article %d/%d rejected: %s" (+ i 1) total (gnus-status-message)))
- (sit-for 3))
- ))
))
-
+
(defvar mime/window-config-alist
'((mail-mode . nil)
(defvar mime/news-reply-mode-server-running nil)
-(defun tm-gnus4/message-before-send ()
- (let ((case-fold-search nil))
- (or (boundp 'mime/news-reply-mode-server-running)
- (make-variable-buffer-local 'mime/news-reply-mode-server-running))
- (setq mime/news-reply-mode-server-running (gnus-server-opened))
- (save-excursion
- (gnus-start-news-server)
- (widen)
- (goto-char (point-min))
- (run-hooks 'news-inews-hook)
- (save-restriction
- (narrow-to-region
- (point-min)
- (progn
- (goto-char (point-min))
- (search-forward (concat "\n" mail-header-separator "\n"))
- (point)))
-
- (goto-char (point-min))
- (if (search-forward-regexp "^Newsgroups: +" nil t)
- (save-restriction
- (narrow-to-region
- (point)
- (if (re-search-forward "^[^ \t]" nil 'end)
- (match-beginning 0)
- (point-max)))
- (goto-char (point-min))
- (replace-regexp "\n[ \t]+" " ")
- (goto-char (point-min))
- (replace-regexp "[ \t\n]*,[ \t\n]*\\|[ \t]+" ",")
- ))
- ))))
(defvar mime/message-before-send-hook-alist
- '((mh-letter-mode . mh-before-send-letter-hook)
- (news-reply-mode . tm-gnus4/message-before-send)
- ))
+ '((mh-letter-mode . mh-before-send-letter-hook)))
(defvar mime/message-after-send-hook-alist
- '((mh-letter-mode . '(lambda ()
+ '((mh-letter-mode . (lambda ()
(if mh-annotate-char
(mh-annotate-msg mh-sent-from-msg
mh-sent-from-folder
(format "\"%s %s\""
(mh-get-field "To:")
(mh-get-field "Cc:"))))))
- (news-reply-mode . '(lambda ()
- (or mime/news-reply-mode-server-running
- (gnus-close-server))
- (and (fboundp 'bury-buffer) (bury-buffer))))
))
(defvar tm-comp/message-inserter-alist nil)
(insert
(format "Subject: %s (%d/%d)\n" subject (+ i 1) total))
(insert
- (format "Mime-Version: 1.0\n"))
+ (format "Mime-Version: 1.0 (split by tm-comp %s)\n"
+ mime/composer-version))
(insert
(format
"Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
(setq i (+ i 1))
)
)
- (let ((hook (eval (cdr (assq major-mode mime/message-after-send-hook-alist)))))
+ (let ((hook
+ (cdr (assq major-mode mime/message-after-send-hook-alist))))
(run-hooks 'hook))
(set-buffer-modified-p nil)
(cond ((y-or-n-p "Kill draft buffer? ")
;;;
-;;; $Id: tm-mule.el,v 6.3 1995/08/26 18:42:32 morioka Exp $
+;;; $Id: tm-mule.el,v 6.4 1995/08/27 13:33:13 morioka Exp $
;;;
(require 'emu)
;;; @ define charset and encoding
;;;
+
(defun mime/set-charset-and-encoding (lc cs charset encoding)
(setq mime/lc-charset-and-encoding-alist
(put-alist lc (cons charset encoding)
(mime/remove-leading-character str)
str)))))
-;; by mol. 1993/10/4
-(defun mime/decode-encoded-text (charset encoding str)
- (mime/convert-string-to-emacs
- charset
- (cond ((string-match "^B$" encoding)
- (mime/base64-decode-string str))
- ((string-match "^Q$" encoding)
- (mime/Quoted-Printable-decode-string str))
- (t (message "unknown encoding %s" encoding) str)
- )))
-
(defun mime/code-convert-region-to-emacs (beg end charset &optional encoding)
(if (stringp charset)
)))
-(run-hooks 'tm-mule-load-hook)
+;;; @ end
+;;;
(provide 'tm-mule)
+
+(run-hooks 'tm-mule-load-hook)
;;;
-;;; $Id: tm-nemacs.el,v 6.1 1995/08/26 18:44:31 morioka Exp $
+;;; $Id: tm-nemacs.el,v 6.3 1995/08/27 14:24:22 morioka Exp $
;;;
(require 'emu)
;;; @ variables
;;;
-(defvar mime/default-coding-system 2)
+(defvar mime/default-coding-system *junet*)
(defvar mime/lc-charset-and-encoding-alist
- (list
- (cons lc-ascii nil)
- (cons lc-jp '("ISO-2022-JP" . "B"))
- ))
+ (list (cons lc-ascii nil)
+ (cons lc-jp '("ISO-2022-JP" . "B"))
+ ))
+
+(defvar mime/latin-lc-list (list lc-ascii))
+
+
+;;; @ functions
+;;;
-(defvar mime/latin-lc-list
- (list lc-ascii))
-
-;; by mol. 1993/10/4
(defun mime/convert-string-to-emacs (charset str)
- (cond ((string-match "^ISO-2022-JP$" charset)
- (convert-string-kanji-code str 2 3))
- ((string-match "^US-ASCII$" charset) str)
+ (cond ((string= "ISO-2022-JP" charset)
+ (convert-string-kanji-code str *junet* *internal*))
+ ((string= "US-ASCII" charset) str)
((string-match "^ISO-8859-[1-9]$" charset)
(check-ASCII-string str))
- (t nil)
))
-;; by mol. 1993/11/2
(defun mime/convert-string-from-emacs (string charset)
- (cond ((equal charset "ISO-2022-JP")
+ (cond ((string= charset "ISO-2022-JP")
(code-convert-string string *internal* *junet*))
- ((equal charset "US-ASCII") string)
- (t nil)
+ ((string= charset "US-ASCII") string)
))
-;; by mol. 1993/10/4
-(defun mime/decode-encoded-text (charset encoding str)
- (let ((ds (mime/convert-string-to-emacs
- charset
- (cond ((string-match "^B$" encoding)
- (mime/base64-decode-string str))
- ((string-match "^Q$" encoding)
- (mime/Quoted-Printable-decode-string str))
- (t
- (message "unknown encoding %s" encoding)
- (concat "=?" charset "?" encoding "?" str "?=")
- )))))
- (if ds
- ds
- (concat "=?" charset "?" encoding "?" str "?="))
- ))
-
(defun mime/code-convert-region-to-emacs (beg end charset &optional encoding)
(if (stringp charset)
(progn
(setq charset (upcase charset))
(if (string= charset "ISO-2022-JP")
- (convert-region-kanji-code beg end 2 3)
+ (convert-region-kanji-code beg end *junet* *internal*)
))))
-(run-hooks 'tm-nemacs-load-hook)
+
+;;; @ end
+;;;
(provide 'tm-nemacs)
+
+(run-hooks 'tm-nemacs-load-hook)
;;;
-;;; $Id: tm-orig.el,v 6.1 1995/08/26 18:46:27 morioka Exp $
+;;; $Id: tm-orig.el,v 6.3 1995/08/27 14:26:18 morioka Exp $
;;;
(require 'emu)
(defvar mime/default-coding-system nil)
(defvar mime/lc-charset-and-encoding-alist
- (list
- (cons lc-ascii nil)
- (cons lc-ltn1 '("ISO-8859-1" . "Q"))
- ))
+ (list (cons lc-ascii nil)
+ (cons lc-ltn1 '("ISO-8859-1" . "Q"))
+ ))
-(defvar mime/latin-lc-list
- (list lc-ascii lc-ltn1))
+(defvar mime/latin-lc-list (list lc-ascii lc-ltn1))
(defvar mime/decoding-charset-list '("US-ASCII" "ISO-8859-1"))
;;; @ functions
;;;
-;; by mol. 1993/10/4
(defun mime/convert-string-to-emacs (charset str)
- (cond ((string-match "^US-ASCII$" charset) str)
- ((string-match "^ISO-8859-1$" charset) str)
- ))
-
-;; by mol. 1993/11/2
-(defun mime/convert-string-from-emacs (string charset)
- (cond ((equal charset "US-ASCII") string)
- ((equal charset "ISO-8859-1") string)
- ))
-
-(defun mime/decode-encoded-text (charset encoding str)
- (if (member charset mime/decoding-charset-list)
- (cond ((string-match "^B$" encoding)
- (mime/base64-decode-string str))
- ((string-match "^Q$" encoding)
- (mime/Quoted-Printable-decode-string str))
- (t (message "unknown encoding %s" encoding)
- (concat "=?" charset "?" encoding "?" str "?=")
- ))
- (concat "=?" charset "?" encoding "?" str "?=")
- ))
-
+ (if (or (string= "US-ASCII" charset)
+ (string= "ISO-8859-1" charset))
+ str))
+
+(defun mime/convert-string-from-emacs (str charset)
+ (if (or (string= charset "US-ASCII")
+ (string= charset "ISO-8859-1"))
+ str))
(defun mime/code-convert-region-to-emacs (beg end charset &optional encoding)
)
;;;
(defconst mime-viewer/RCS-ID
- "$Id: tm-view.el,v 6.73 1995/08/26 19:53:34 morioka Exp $")
+ "$Id: tm-view.el,v 6.74 1995/08/27 19:05:58 morioka Exp $")
(defconst mime-viewer/version (get-version-string mime-viewer/RCS-ID))
(defconst mime/viewer-version mime-viewer/version)
;;; @ constants
;;;
-(defconst mime/tspecials "\000-\040()<>@,;:\\\"/[\093?.=")
-(defconst mime/token-regexp
- (concat "[^" mime/tspecials "]*"))
(defconst mime/content-type-subtype-regexp
(concat mime/token-regexp "/" mime/token-regexp))
(defconst mime/content-parameter-value-regexp