From 6b1a86ff624ba69ec404312f145c63d2d59fd38c Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 23 Feb 2016 14:05:18 +1100 Subject: Don't use mm-util functions in qp.el * lisp/gnus/qp.el (quoted-printable-decode-region): Don't use mm-util functions. (quoted-printable-encode-string): Ditto. (quoted-printable-encode-region): Ditto. --- lisp/gnus/qp.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el index 71e838a9b3..a295e0c2d8 100644 --- a/lisp/gnus/qp.el +++ b/lisp/gnus/qp.el @@ -27,9 +27,6 @@ ;;; Code: -(require 'mm-util) -(defvar mm-use-ultra-safe-encoding) - ;;;###autoload (defun quoted-printable-decode-region (from to &optional coding-system) "Decode quoted-printable in the region between FROM and TO, per RFC 2045. @@ -45,7 +42,8 @@ them into characters should be done separately." (interactive ;; Let the user determine the coding system with "C-x RET c". (list (region-beginning) (region-end) coding-system-for-read)) - (unless (mm-coding-system-p coding-system) ; e.g. `ascii' from Gnus + (when (and coding-system + (not (coding-system-p coding-system))) ; e.g. `ascii' from Gnus (setq coding-system nil)) (save-excursion (save-restriction @@ -94,7 +92,8 @@ them into characters should be done separately." If CODING-SYSTEM is non-nil, decode the string with coding-system. Use of CODING-SYSTEM is deprecated; this function should deal with raw bytes, and coding conversion should be done separately." - (mm-with-unibyte-buffer + (with-temp-buffer + (set-buffer-multibyte nil) (insert string) (quoted-printable-decode-region (point-min) (point-max) coding-system) (buffer-string))) @@ -138,17 +137,17 @@ encode lines starting with \"From\"." (prog1 (format "=%02X" (char-after)) (delete-char 1))))) - (let ((mm-use-ultra-safe-encoding + (let ((ultra (and (boundp 'mm-use-ultra-safe-encoding) mm-use-ultra-safe-encoding))) - (when (or fold mm-use-ultra-safe-encoding) + (when (or fold ultra) (let ((tab-width 1) ; HTAB is one character. (case-fold-search nil)) (goto-char (point-min)) (while (not (eobp)) ;; In ultra-safe mode, encode "From " at the beginning ;; of a line. - (when mm-use-ultra-safe-encoding + (when ultra (if (looking-at "From ") (replace-match "From=20" nil t) (if (looking-at "-") @@ -167,8 +166,8 @@ encode lines starting with \"From\"." "Encode the STRING as quoted-printable and return the result." (with-temp-buffer (if (multibyte-string-p string) - (mm-enable-multibyte) - (mm-disable-multibyte)) + (set-buffer-multibyte 'to) + (set-buffer-multibyte nil)) (insert string) (quoted-printable-encode-region (point-min) (point-max)) (buffer-string))) -- cgit v1.2.3