aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2002-10-16 16:24:19 +0000
committerDave Love2002-10-16 16:24:19 +0000
commit43e0a0c5a4e93aa64753da60be336f301c0325dd (patch)
tree3ebe62db866bc06c4b23e97260b51031c1875cf0
parent0ce7886f8dc08eaf195578fc066751f264d24f64 (diff)
downloademacs-43e0a0c5a4e93aa64753da60be336f301c0325dd.tar.gz
emacs-43e0a0c5a4e93aa64753da60be336f301c0325dd.zip
(quoted-printable-encode-region): Fix non-Emacs 22 case.
-rw-r--r--lisp/gnus/qp.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el
index 6ceeb259ae1..67a4dd8ecd3 100644
--- a/lisp/gnus/qp.el
+++ b/lisp/gnus/qp.el
@@ -35,7 +35,10 @@
35(defun quoted-printable-decode-region (from to &optional coding-system) 35(defun quoted-printable-decode-region (from to &optional coding-system)
36 "Decode quoted-printable in the region between FROM and TO, per RFC 2045. 36 "Decode quoted-printable in the region between FROM and TO, per RFC 2045.
37If CODING-SYSTEM is non-nil, decode bytes into characters with that 37If CODING-SYSTEM is non-nil, decode bytes into characters with that
38coding-system." 38coding-system.
39
40Interactively, you can supply the CODING-SYSTEM argument
41with \\[universal-coding-system-argument]."
39 (interactive 42 (interactive
40 ;; 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".
41 (list (region-beginning) (region-end) coding-system-for-read)) 44 (list (region-beginning) (region-end) coding-system-for-read))
@@ -95,13 +98,12 @@ encode lines starting with \"From\"."
95 (save-excursion 98 (save-excursion
96 (goto-char from) 99 (goto-char from)
97 (if (fboundp 'string-to-multibyte) ; Emacs 22 100 (if (fboundp 'string-to-multibyte) ; Emacs 22
98 ;; Fixme: Should we allow codes in the range \x80-\xff?
99 (if (re-search-forward (string-to-multibyte "[^\x0-\x7f\x80-\xff]") 101 (if (re-search-forward (string-to-multibyte "[^\x0-\x7f\x80-\xff]")
100 to t) 102 to t)
101 ;; Fixme: Improve message. 103 ;; Fixme: This is somewhat misleading.
102 (error "Multibyte character in QP encoding region") 104 (error "Multibyte character in QP encoding region"))
103 (if (re-search-forward "[^\x0-\xff]" to t) 105 (if (re-search-forward (mm-string-as-multibyte "[^\0-\377]") to t)
104 (error "Multibyte character in QP encoding region"))))) 106 (error "Multibyte character in QP encoding region"))))
105 (unless class 107 (unless class
106 ;; Avoid using 8bit characters. = is \075. 108 ;; Avoid using 8bit characters. = is \075.
107 ;; Equivalent to "^\000-\007\013\015-\037\200-\377=" 109 ;; Equivalent to "^\000-\007\013\015-\037\200-\377="
@@ -115,7 +117,7 @@ encode lines starting with \"From\"."
115 (not (eobp))) 117 (not (eobp)))
116 (insert 118 (insert
117 (prog1 119 (prog1
118 ;; To unibyte in case of eight-bit-{control,graphics} 120 ;; To unibyte in case of Emacs 22 eight-bit.
119 (format "=%02X" (multibyte-char-to-unibyte (char-after))) 121 (format "=%02X" (multibyte-char-to-unibyte (char-after)))
120 (delete-char 1)))) 122 (delete-char 1))))
121 ;; Encode white space at the end of lines. 123 ;; Encode white space at the end of lines.