(require 'mel)
(require 'tl-header)
(require 'tl-str)
+(require 'tm-def)
;;; @ version
;;;
(defconst mime/RCS-ID
- "$Id: tiny-mime.el,v 6.2 1995/08/27 19:05:07 morioka Exp $")
+ "$Id: tiny-mime.el,v 6.7 1995/09/20 12:17:28 morioka Exp $")
(defconst mime/tiny-mime-version (get-version-string mime/RCS-ID))
;;; @ MIME encoded-word definition
;;;
-(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/Base64-encoded-text-regexp
- (concat "\\("
- mime/Base64-token-regexp
- mime/Base64-token-regexp
- mime/Base64-token-regexp
- mime/Base64-token-regexp
- "\\)+"))
-(defconst mime/Base64-encoding-and-encoded-text-regexp
- (concat "\\(B\\)\\?" mime/Base64-encoded-text-regexp))
-
-(defconst mime/Quoted-Printable-hex-char-regexp "[0123456789ABCDEF]")
-(defconst mime/Quoted-Printable-octet-regexp
- (concat "="
- mime/Quoted-Printable-hex-char-regexp
- mime/Quoted-Printable-hex-char-regexp))
-(defconst mime/Quoted-Printable-encoded-text-regexp
- (concat "\\([^=?]\\|" mime/Quoted-Printable-octet-regexp "\\)+"))
-(defconst mime/Quoted-Printable-encoding-and-encoded-text-regexp
- (concat "\\(Q\\)\\?" mime/Quoted-Printable-encoded-text-regexp))
-
(defconst mime/encoded-word-regexp (concat (regexp-quote "=?")
"\\("
mime/charset-regexp
(defvar mime/use-X-Nsubject nil)
-;;; @ compatible module among Mule, NEmacs and NEpoch
-;;;
-
-(cond ((boundp 'MULE) (require 'tm-mule))
- ((boundp 'NEMACS)(require 'tm-nemacs))
- (t (require 'tm-orig))
- )
-
-
;;; @ Application Interface
;;;
))
))
+(defun mime/exist-encoded-word-in-subject ()
+ (let ((str (message/get-field-body "Subject")))
+ (if (and str (string-match mime/encoded-word-regexp str))
+ str)))
+
(defun mime/encode-message-header ()
(interactive "*")
(save-excursion
)))
))
(if mime/use-X-Nsubject
- (progn
- (goto-char (point-min))
- (if (re-search-forward "^Subject:.*\\(\n\\s +.*\\)*" nil t)
- (let ((str (buffer-substring (match-beginning 0)
- (match-end 0))))
- (if (string-match mime/encoded-word-regexp str)
- (insert (concat
- "\nX-Nsubject: "
- (nth 1 (message/divide-field
- (mime/decode-string
- (message/unfolding-string str))
- ))))
- ))
- )))
+ (let ((str (mime/exist-encoded-word-in-subject)))
+ (if str
+ (insert (concat
+ "\nX-Nsubject: "
+ (mime/decode-string (message/unfolding-string str))
+ )))))
)))
(let (field beg end)
(while (re-search-forward message/field-name-regexp nil t)
(setq beg (match-beginning 0))
- (setq end (progn
- (if (re-search-forward "\n[!-9;-~]+:" nil t)
- (goto-char (match-beginning 0))
- (if (re-search-forward "^$" nil t)
- (goto-char (1- (match-beginning 0)))
- (end-of-line)
- ))
- (point)
- ))
+ (setq end (message/field-end))
(setq field (buffer-substring beg end))
(if (string-match mime/encoded-word-regexp field)
(save-restriction