From 35310098365bc17772ae71d80f743b1b85a57bb8 Mon Sep 17 00:00:00 2001 From: Henrik Enberg Date: Tue, 17 Jan 2006 22:31:55 +0000 Subject: [PATCH] (rmail-process-new-messages): Add an X-Coding-System header if one doesn't exist. --- lisp/mail/ChangeLog | 9 +++++++++ lisp/mail/rmail.el | 14 +++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lisp/mail/ChangeLog b/lisp/mail/ChangeLog index 59bc26301b3..63989e11971 100644 --- a/lisp/mail/ChangeLog +++ b/lisp/mail/ChangeLog @@ -1,3 +1,12 @@ +2006-01-17 Henrik Enberg + + * rmailkwd.el: Don't require rmail. + + * rmail.el (rmail-process-new-messages): Don't require rmailkwd + here, do it at toplevel instead. + (rmail-process-new-messages): Add an X-Coding-System + header if one doesn't exist. + 2006-01-17 Alex Schroeder * rmailsum.el (rmail-summary-by-labels): No longer concatenate diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index e0bc1378882..dea879addb1 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1944,7 +1944,8 @@ non-nil then do not show any progress messages." (case-fold-search nil) (new-message-counter 0) (start (point-max)) - end attributes keywords message-descriptor-list date) + end attributes keywords message-descriptor-list + date coding) (or nomsg (message "Processing new messages...")) ;; Process each message in turn starting from the back and ;; proceeding to the front of the region. This is especially a @@ -1985,6 +1986,17 @@ non-nil then do not show any progress messages." (delete-char 1))) (setq end (marker-position end-marker)) (set-marker end-marker nil))) + + ;; Add an X-Coding-System header if we don't have one. + (unless (rmail-header-get-header "X-Coding-System") + (let ((case-fold-search t)) + (when (save-excursion + (goto-char start) + (search-forward "\n\n" nil t) + (re-search-backward rmail-mime-charset-pattern start t)) + (rmail-header-add-header "X-Coding-System" + (downcase (match-string 1)))))) + ;; Make sure we have an Rmail BABYL attribute header field. ;; All we can assume is that the Rmail BABYL header field is ;; in the header section. It's placement can be modified by -- 2.39.2