+2003-05-20 Dave Love <fx@gnu.org>
+
+ * rfc2047.el (rfc2047-q-encoding-alist): Deleted.
+ (rfc2047-q-encode-region): Don't use it.
+ (rfc2047-encode-message-header) <(eq method 'mime)>: Bind
+ rfc2047-encoding-type to `mime'.
+ (rfc2047-encode-string, rfc2047-encode): Doc fix.
+
2003-05-20 Jesper Harder <harder@ifa.au.dk>
* message.el (message-send-mail): Don't insert a courtesy copy
2003-05-12 Dave Love <fx@gnu.org>
+ * mm-util.el (mm-read-charset): Deleted.
+ (mm-coding-system-mime-charset): New.
+ (mm-read-coding-system, mm-mule-charset-to-mime-charset)
+ (mm-charset-to-coding-system, mm-mime-charset)
+ (mm-find-mime-charset-region): Use it.
+ (mm-default-multibyte-p): Fix non-mule case.
+
* rfc2047.el (rfc2047-point-at-bol, rfc2047-point-at-bol): Eval
and compile.
(rfc2047-syntax-table): Fix building table to work in Emacs 22.
(nil . ignore))
"Alist of RFC2047 encodings to encoding functions.")
-(defvar rfc2047-q-encoding-alist
- '(("\\(Resent-\\)?\\(From\\|Cc\\|To\\|Bcc\\|Reply-To\\|Sender\\):"
- . "-A-Za-z0-9!*+/" )
- ;; = (\075), _ (\137), ? (\077) are used in the encoded word.
- ;; Avoid using 8bit characters.
- ;; Equivalent to "^\000-\007\011\013\015-\037\200-\377=_?"
- ("." . "\010\012\014\040-\074\076\100-\136\140-\177"))
- "Alist of header regexps and valid Q characters.")
-
;;;
;;; Functions for encoding RFC2047 messages
;;;
((eq method 'address-mime)
(rfc2047-encode-region (point) (point-max)))
((eq method 'mime)
- (let (rfc2047-encoding-type)
+ (let ((rfc2047-encoding-type 'mime))
(rfc2047-encode-region (point) (point-max))))
((eq method 'default)
(if (and (featurep 'mule)
(defun rfc2047-encode-string (string)
"Encode words in STRING.
By default, the string is treated as containing addresses (see
-`rfc2047-special-chars')."
+`rfc2047-encoding-type')."
(with-temp-buffer
(insert string)
(rfc2047-encode-region (point-min) (point-max))
(defun rfc2047-encode (b e)
"Encode the word(s) in the region B to E.
By default, the region is treated as containing addresses (see
-`rfc2047-special-chars')."
+`rfc2047-encoding-type')."
(let* ((mime-charset (mm-find-mime-charset-region b e))
(cs (if (> (length mime-charset) 1)
;; Fixme: Instead of this, try to break region into
(save-excursion
(save-restriction
(narrow-to-region (goto-char b) e)
- (let ((alist rfc2047-q-encoding-alist)
- (bol (save-restriction
+ (let ((bol (save-restriction
(widen)
(rfc2047-point-at-bol))))
- (while alist
- (when (looking-at (caar alist))
- (quoted-printable-encode-region b e nil (cdar alist))
- (subst-char-in-region (point-min) (point-max) ? ?_)
- (setq alist nil))
- (pop alist))
+ (quoted-printable-encode-region
+ b e nil
+ ;; = (\075), _ (\137), ? (\077) are used in the encoded word.
+ ;; Avoid using 8bit characters.
+ ;; Equivalent to "^\000-\007\011\013\015-\037\200-\377=_?"
+ "\010\012\014\040-\074\076\100-\136\140-\177")
+ (subst-char-in-region (point-min) (point-max) ? ?_)
;; The size of QP encapsulation is about 20, so set limit to
;; 56=76-20.
(unless (< (- (point-max) (point-min)) 56)