Set save-buffer-coding-system instead of buffer-file-coding-system.
Decode the whole Babyl text at once, not message by message.
Don't alter global value of rmail-file-coding-system.
(rmail-show-message): Set buffer-file-coding-system from
X-Coding-System header field.
(rmail-convert-to-babyl-format): Record X-Coding-System header
for each message that was converted.
(rmail-variables): Make local binding for save-buffer-coding-system,
and set it from buffer-file-coding-system if not already non-nil.
(rmail-ignored-headers): Ignore X-Coding-System header.
Ignore Return-Path, Errors-To, X-Attribution, X-Disclaimer.
whose headers have not been reformatted.
(rmail-message-recipients-p): Likewise.
(rmail-movemail-program): Customized.
(rmail-message-filter): Customized.
(rmail-display-summary): Customized.
(rmail-inbox-list, rmail-keywords, rmail-current-message)
(rmail-total-messages, rmail-message-vector, rmail-deleted-vector)
(rmail-msgref-vector, rmail-overlay-list, rmail-view-buffer)
(rmail-last-label, rmail-last-regexp): Now permanent locals.
(rmail-perm-variables): Set up all permanent locals here.
(rmail-variables): Not here.
(rmail-variables): Set enable-local-variables here.
(rmail-mode-2): Not here.
(rmail): Bind coding-system-for-read to raw-text. Set the buffer
multibyte if necessary.
(rmail-convert-file): Call rmail-decode-babyl-format only when we
don't have to call rmail-convert-to-babyl-format.
(rmail-decode-babyl-format): If rmail-file-coding-system is nil,
detect it.
(rmail-get-new-mail): Bind rmail-enable-multibyte locally.
(rmail-convert-to-babyl-format): Check the value of
rmail-enable-multibyte instead of enable-multibyte-characters.
read the file normally.
(rmail-revert): Likewise.
(rmail): Don't kill local enable-multibyte-characters.
Don't bind coding-system-for-read. Fix error message.
(rmail-make-in-reply-to-field):
Make foo and bar patterns match all non-ASCII chars.
mostly copied from gnus-art.el.
(rmail-hex-string-to-integer): New fn, copied from hexl.el.
(rmail-hex-char-to-integer): Likewise.
(rmail-convert-to-babyl-format): Use rmail-decode-quoted-printable.
(rmail-insert-inbox-text): If there's an error getting mail from
the POP server, and the error matches rmail-pop-password-error or
we prompted for the POP password, assume that the password is
incorrect and erase it so that the user will be prompted again the
next time he gets mail.
(rmail-revert): Bind enable-multibyte-characters to nil before
calling rmail-convert-file.
(rmail-convert-to-babyl-format): If enable-multibyte-characters is
nil, do not convert code.