projects
/
elisp
/
tm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was generated by cvs2svn to compensate for changes in r431,
[elisp/tm.git]
/
tm-ew-d.el
diff --git
a/tm-ew-d.el
b/tm-ew-d.el
index
3232770
..
0eabbea
100644
(file)
--- a/
tm-ew-d.el
+++ b/
tm-ew-d.el
@@
-10,7
+10,7
@@
;;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1993/6/3 (1995/10/3 obsolete tiny-mime.el)
;;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1993/6/3 (1995/10/3 obsolete tiny-mime.el)
-;;; Version: $Revision: 7.10 $
+;;; Version: $Revision: 7.18 $
;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word
;;;
;;; This file is part of tm (Tools for MIME).
;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word
;;;
;;; This file is part of tm (Tools for MIME).
@@
-41,7
+41,7
@@
;;;
(defconst tm-ew-d/RCS-ID
;;;
(defconst tm-ew-d/RCS-ID
- "$Id: tm-ew-d.el,v 7.10 1996/04/19 08:24:15 morioka Exp $")
+ "$Id: tm-ew-d.el,v 7.18 1996/08/07 15:50:44 morioka Exp $")
(defconst mime/eword-decoder-version (get-version-string tm-ew-d/RCS-ID))
(defconst mime/eword-decoder-version (get-version-string tm-ew-d/RCS-ID))
@@
-65,7
+65,7
@@
;;; @ for string
;;;
;;; @ for string
;;;
-(defun mime-eword/decode-string (str)
+(defun mime-eword/decode-string (str &optional unfolding)
(setq str (rfc822/unfolding-string str))
(let ((dest "")(ew nil)
beg end)
(setq str (rfc822/unfolding-string str))
(let ((dest "")(ew nil)
beg end)
@@
-81,9
+81,11
@@
(setq dest (concat dest (substring str 0 beg)))
)
)
(setq dest (concat dest (substring str 0 beg)))
)
)
- (setq dest (concat dest
- (mime/decode-encoded-word (substring str beg end))
- ))
+ (setq dest
+ (concat dest
+ (mime/decode-encoded-word
+ (substring str beg end) unfolding)
+ ))
(setq str (substring str end))
(setq ew t)
)
(setq str (substring str end))
(setq ew t)
)
@@
-94,7
+96,7
@@
;;; @ for region
;;;
;;; @ for region
;;;
-(defun mime-eword/decode-region (beg end &optional unfolding)
+(defun mime-eword/decode-region (beg end &optional unfolding must-unfold)
(interactive "*r")
(save-excursion
(save-restriction
(interactive "*r")
(save-excursion
(save-restriction
@@
-111,12
+113,11
@@
(goto-char (point-min))
(let (charset encoding text)
(while (re-search-forward mime/encoded-word-regexp nil t)
(goto-char (point-min))
(let (charset encoding text)
(while (re-search-forward mime/encoded-word-regexp nil t)
- (insert (mime/decode-encoded-word
+ (insert (mime/decode-encoded-word
(prog1
(buffer-substring (match-beginning 0) (match-end 0))
(delete-region (match-beginning 0) (match-end 0))
(prog1
(buffer-substring (match-beginning 0) (match-end 0))
(delete-region (match-beginning 0) (match-end 0))
- )
- ))
+ ) must-unfold))
))
)))
))
)))
@@
-154,12
+155,11
@@
;;; @ encoded-word decoder
;;;
;;; @ encoded-word decoder
;;;
-(defun mime/decode-encoded-word (word)
+(defun mime/decode-encoded-word (word &optional unfolding)
(or (if (string-match mime/encoded-word-regexp word)
(let ((charset
(or (if (string-match mime/encoded-word-regexp word)
(let ((charset
- (upcase
- (substring word (match-beginning 1) (match-end 1))
- ))
+ (substring word (match-beginning 1) (match-end 1))
+ )
(encoding
(upcase
(substring word (match-beginning 2) (match-end 2))
(encoding
(upcase
(substring word (match-beginning 2) (match-end 2))
@@
-167,7
+167,7
@@
(text
(substring word (match-beginning 3) (match-end 3))
))
(text
(substring word (match-beginning 3) (match-end 3))
))
- (mime/decode-encoded-text charset encoding text)
+ (mime/decode-encoded-text charset encoding text unfolding)
))
word))
))
word))
@@
-175,17
+175,21
@@
;;; @ encoded-text decoder
;;;
;;; @ encoded-text decoder
;;;
-(defun mime/decode-encoded-text (charset encoding str)
+(defun mime/decode-encoded-text (charset encoding str &optional unfolding)
(let ((dest
(let ((dest
- (cond ((string= "B" encoding)
+ (cond ((string-equal "B" encoding)
(base64-decode-string str))
(base64-decode-string str))
- ((string= "Q" encoding)
+ ((string-equal "Q" encoding)
(q-encoding-decode-string str))
(t (message "unknown encoding %s" encoding)
nil))))
(if dest
(q-encoding-decode-string str))
(t (message "unknown encoding %s" encoding)
nil))))
(if dest
- (mime/convert-string-to-emacs dest charset)
- )))
+ (progn
+ (setq dest (decode-mime-charset-string dest charset))
+ (if unfolding
+ (rfc822/unfolding-string dest)
+ dest)
+ ))))
;;; @ end
;;; @ end