diff options
| author | Lars Ingebrigtsen | 2016-02-23 14:05:18 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-23 14:05:18 +1100 |
| commit | 6b1a86ff624ba69ec404312f145c63d2d59fd38c (patch) | |
| tree | ffe056d7e20385f88410fe729b4bbc95ee66599b | |
| parent | f956efb946220f274ec90ea89307dcd9653c9115 (diff) | |
| download | emacs-6b1a86ff624ba69ec404312f145c63d2d59fd38c.tar.gz emacs-6b1a86ff624ba69ec404312f145c63d2d59fd38c.zip | |
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.
| -rw-r--r-- | lisp/gnus/qp.el | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el index 71e838a9b39..a295e0c2d8e 100644 --- a/lisp/gnus/qp.el +++ b/lisp/gnus/qp.el | |||
| @@ -27,9 +27,6 @@ | |||
| 27 | 27 | ||
| 28 | ;;; Code: | 28 | ;;; Code: |
| 29 | 29 | ||
| 30 | (require 'mm-util) | ||
| 31 | (defvar mm-use-ultra-safe-encoding) | ||
| 32 | |||
| 33 | ;;;###autoload | 30 | ;;;###autoload |
| 34 | (defun quoted-printable-decode-region (from to &optional coding-system) | 31 | (defun quoted-printable-decode-region (from to &optional coding-system) |
| 35 | "Decode quoted-printable in the region between FROM and TO, per RFC 2045. | 32 | "Decode quoted-printable in the region between FROM and TO, per RFC 2045. |
| @@ -45,7 +42,8 @@ them into characters should be done separately." | |||
| 45 | (interactive | 42 | (interactive |
| 46 | ;; Let the user determine the coding system with "C-x RET c". | 43 | ;; Let the user determine the coding system with "C-x RET c". |
| 47 | (list (region-beginning) (region-end) coding-system-for-read)) | 44 | (list (region-beginning) (region-end) coding-system-for-read)) |
| 48 | (unless (mm-coding-system-p coding-system) ; e.g. `ascii' from Gnus | 45 | (when (and coding-system |
| 46 | (not (coding-system-p coding-system))) ; e.g. `ascii' from Gnus | ||
| 49 | (setq coding-system nil)) | 47 | (setq coding-system nil)) |
| 50 | (save-excursion | 48 | (save-excursion |
| 51 | (save-restriction | 49 | (save-restriction |
| @@ -94,7 +92,8 @@ them into characters should be done separately." | |||
| 94 | If CODING-SYSTEM is non-nil, decode the string with coding-system. | 92 | If CODING-SYSTEM is non-nil, decode the string with coding-system. |
| 95 | Use of CODING-SYSTEM is deprecated; this function should deal with | 93 | Use of CODING-SYSTEM is deprecated; this function should deal with |
| 96 | raw bytes, and coding conversion should be done separately." | 94 | raw bytes, and coding conversion should be done separately." |
| 97 | (mm-with-unibyte-buffer | 95 | (with-temp-buffer |
| 96 | (set-buffer-multibyte nil) | ||
| 98 | (insert string) | 97 | (insert string) |
| 99 | (quoted-printable-decode-region (point-min) (point-max) coding-system) | 98 | (quoted-printable-decode-region (point-min) (point-max) coding-system) |
| 100 | (buffer-string))) | 99 | (buffer-string))) |
| @@ -138,17 +137,17 @@ encode lines starting with \"From\"." | |||
| 138 | (prog1 | 137 | (prog1 |
| 139 | (format "=%02X" (char-after)) | 138 | (format "=%02X" (char-after)) |
| 140 | (delete-char 1))))) | 139 | (delete-char 1))))) |
| 141 | (let ((mm-use-ultra-safe-encoding | 140 | (let ((ultra |
| 142 | (and (boundp 'mm-use-ultra-safe-encoding) | 141 | (and (boundp 'mm-use-ultra-safe-encoding) |
| 143 | mm-use-ultra-safe-encoding))) | 142 | mm-use-ultra-safe-encoding))) |
| 144 | (when (or fold mm-use-ultra-safe-encoding) | 143 | (when (or fold ultra) |
| 145 | (let ((tab-width 1) ; HTAB is one character. | 144 | (let ((tab-width 1) ; HTAB is one character. |
| 146 | (case-fold-search nil)) | 145 | (case-fold-search nil)) |
| 147 | (goto-char (point-min)) | 146 | (goto-char (point-min)) |
| 148 | (while (not (eobp)) | 147 | (while (not (eobp)) |
| 149 | ;; In ultra-safe mode, encode "From " at the beginning | 148 | ;; In ultra-safe mode, encode "From " at the beginning |
| 150 | ;; of a line. | 149 | ;; of a line. |
| 151 | (when mm-use-ultra-safe-encoding | 150 | (when ultra |
| 152 | (if (looking-at "From ") | 151 | (if (looking-at "From ") |
| 153 | (replace-match "From=20" nil t) | 152 | (replace-match "From=20" nil t) |
| 154 | (if (looking-at "-") | 153 | (if (looking-at "-") |
| @@ -167,8 +166,8 @@ encode lines starting with \"From\"." | |||
| 167 | "Encode the STRING as quoted-printable and return the result." | 166 | "Encode the STRING as quoted-printable and return the result." |
| 168 | (with-temp-buffer | 167 | (with-temp-buffer |
| 169 | (if (multibyte-string-p string) | 168 | (if (multibyte-string-p string) |
| 170 | (mm-enable-multibyte) | 169 | (set-buffer-multibyte 'to) |
| 171 | (mm-disable-multibyte)) | 170 | (set-buffer-multibyte nil)) |
| 172 | (insert string) | 171 | (insert string) |
| 173 | (quoted-printable-encode-region (point-min) (point-max)) | 172 | (quoted-printable-encode-region (point-min) (point-max)) |
| 174 | (buffer-string))) | 173 | (buffer-string))) |