[mew-int 2722] Display base64 encoded body in summary mode
Kan-Ru Chen <[email protected]>
| Newsgroups | gmane.mail.mew.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I am new to Mew, and found it pretty easy to use. Kudos!
However, I found that base64 encoded mails are not displayed in
summary mode. I receive this kind of mail very often. It's very useful
that I can preview the body in summary line so that I can skim through
the mails and read interested one.
Patch is attached. Maybe this can become a option?
Kanru
enable-base64-scan.diff
(text/x-patch, 2.1 KB)
Index: mew-env.el
===================================================================
RCS file: /cvsmew/mew/mew-env.el,v
retrieving revision 1.63
diff -u -r1.63 mew-env.el
--- mew-env.el 27 Feb 2009 03:45:55 -0000 1.63
+++ mew-env.el 18 Aug 2009 15:08:12 -0000
@@ -200,6 +200,11 @@
(base64-decode-string str64)
(error nil)))
+(defun mew-base64-decode-region (beg end)
+ (condition-case nil
+ (base64-decode-region beg end)
+ (error nil)))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Language
Index: mew-scan.el
===================================================================
RCS file: /cvsmew/mew/mew-scan.el,v
retrieving revision 1.250
diff -u -r1.250 mew-scan.el
--- mew-scan.el 21 Jan 2009 05:54:58 -0000 1.250
+++ mew-scan.el 18 Aug 2009 15:08:13 -0000
@@ -528,14 +528,13 @@
(cte (MEW-CTE))
(body "")
(case-fold-search t)
- textp charset cs beg skip boundary found regex)
+ textp charset cs beg end skip boundary found regex)
(catch 'break
(cond
(draftp
(setq textp t)
(setq cs mew-cs-m17n))
((string= ctr "")
- (if (mew-case-equal cte mew-b64) (throw 'break nil))
(setq textp t)
(setq cs mew-cs-autoconv))
(t
@@ -565,7 +564,6 @@
(setq textp t)
(setq cs mew-cs-autoconv)
(throw 'break nil))))
- (if (and cte (mew-case-equal cte mew-b64)) (throw 'break nil))
(when (string-match "^Text/Plain" ctr)
(when (string-match "charset=\"?\\([^\"\n\t;]+\\)\"?" ctr)
(setq charset (mew-match-string 1 ctr)))
@@ -573,6 +571,15 @@
(setq textp t)
(setq cs (mew-charset-to-cs charset))
(if (null cs) (setq cs mew-cs-autoconv)))))) ;; end of 'break
+ (if (not (and cte (mew-case-equal cte mew-b64)))
+ nil
+ (setq beg (point))
+ (if (not found)
+ (setq end (point-max))
+ (while (not (looking-at boundary)) (forward-line))
+ (setq end (point)))
+ (goto-char beg)
+ (mew-base64-decode-region beg end))
(when (and textp (mew-coding-system-p cs))
(setq i 0)
(while (and (not (eobp)) (< i I) (< j J))