From fe83a3004e64d1c348a9ec4c6487e3d5d5858645 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 27 Jan 2009 04:48:56 +0000 Subject: [PATCH] (rmail-get-coding-system): Re-search rmail-mime-charset-pattern directly instead of using mail-fetch-field. Use coding-system-from-name. --- lisp/ChangeLog | 9 +++++++++ lisp/mail/rmail.el | 11 ++++------- 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 @@ +2009-01-27 Kenichi Handa + + * mail/rmail.el (rmail-get-coding-system): Re-search + rmail-mime-charset-pattern directly instead of using + mail-fetch-field. Use coding-system-from-name. + + * international/mule-cmds.el (canonicalize-coding-system-name) + (coding-system-from-name): New functions. + 2009-01-27 Glenn Morris * 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." (defun rmail-get-coding-system () "Return a suitable coding system to use for the current mail message. The buffer is expected to be narrowed to just the header of the message." - (let ((content-type-header (mail-fetch-field "content-type")) - separator) - (save-excursion - (setq separator (search-forward "\n\n"))) - (if (and content-type-header - (string-match rmail-mime-charset-pattern content-type-header)) - (substring content-type-header (match-beginning 1) (match-end 1)) + (save-excursion + (goto-char (point-min)) + (if (re-search-forward rmail-mime-charset-pattern) + (coding-system-from-name (match-string 1)) 'undecided))) ;;; Set up Rmail mode keymaps -- 2.39.5