aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2009-01-27 04:48:56 +0000
committerKenichi Handa2009-01-27 04:48:56 +0000
commitfe83a3004e64d1c348a9ec4c6487e3d5d5858645 (patch)
treedad3e98b93a327ecf9c4cf25afd8dc53fcf1d7ef
parentf4017dc56c01b7f8f3d355374bb9418a6138bf42 (diff)
downloademacs-fe83a3004e64d1c348a9ec4c6487e3d5d5858645.tar.gz
emacs-fe83a3004e64d1c348a9ec4c6487e3d5d5858645.zip
(rmail-get-coding-system): Re-search
rmail-mime-charset-pattern directly instead of using mail-fetch-field. Use coding-system-from-name.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/mail/rmail.el11
2 files changed, 13 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1ca5846c1cb..d211dfd4269 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12009-01-27 Kenichi Handa <handa@m17n.org>
2
3 * mail/rmail.el (rmail-get-coding-system): Re-search
4 rmail-mime-charset-pattern directly instead of using
5 mail-fetch-field. Use coding-system-from-name.
6
7 * international/mule-cmds.el (canonicalize-coding-system-name)
8 (coding-system-from-name): New functions.
9
12009-01-27 Glenn Morris <rgm@gnu.org> 102009-01-27 Glenn Morris <rgm@gnu.org>
2 11
3 * dired-x.el (dired-bind-vm): Doc fix. 12 * dired-x.el (dired-bind-vm): Doc fix.
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 99bdcea0516..a96b52b8602 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -940,13 +940,10 @@ This function also reinitializes local variables used by Rmail."
940(defun rmail-get-coding-system () 940(defun rmail-get-coding-system ()
941 "Return a suitable coding system to use for the current mail message. 941 "Return a suitable coding system to use for the current mail message.
942The buffer is expected to be narrowed to just the header of the message." 942The buffer is expected to be narrowed to just the header of the message."
943 (let ((content-type-header (mail-fetch-field "content-type")) 943 (save-excursion
944 separator) 944 (goto-char (point-min))
945 (save-excursion 945 (if (re-search-forward rmail-mime-charset-pattern)
946 (setq separator (search-forward "\n\n"))) 946 (coding-system-from-name (match-string 1))
947 (if (and content-type-header
948 (string-match rmail-mime-charset-pattern content-type-header))
949 (substring content-type-header (match-beginning 1) (match-end 1))
950 'undecided))) 947 'undecided)))
951 948
952;;; Set up Rmail mode keymaps 949;;; Set up Rmail mode keymaps