(mm-qp-or-base64): Always QP iff
authorSimon Josefsson <jas@extundo.com>
Sat, 25 Jan 2003 19:37:26 +0000 (19:37 +0000)
committerSimon Josefsson <jas@extundo.com>
Sat, 25 Jan 2003 19:37:26 +0000 (19:37 +0000)
mm-use-ultra-safe-encoding and cleartext PGP.

lisp/ChangeLog
lisp/mm-encode.el

index 84957ce..e27a505 100644 (file)
@@ -1,5 +1,8 @@
 2003-01-25  Simon Josefsson  <jas@extundo.com>
 
+       * mm-encode.el (mm-qp-or-base64): Always QP iff
+       mm-use-ultra-safe-encoding and cleartext PGP.
+
        * gnus-sum.el (gnus-summary-select-article): Inhibit
        redisplay (mainly for secured messages).
 
index c315c61..1da3dc6 100644 (file)
@@ -164,21 +164,24 @@ The encoding used is returned."
        (pop rules)))))
 
 (defun mm-qp-or-base64 ()
-  (save-excursion
-    (let ((limit (min (point-max) (+ 2000 (point-min))))
-         (n8bit 0))
-      (goto-char (point-min))
-      (skip-chars-forward "\x20-\x7f\r\n\t" limit)
-      (while (< (point) limit)
-       (incf n8bit)
-       (forward-char 1)
-       (skip-chars-forward "\x20-\x7f\r\n\t" limit))
-      (if (or (< (* 6 n8bit) (- limit (point-min)))
-             ;; Don't base64, say, a short line with a single
-             ;; non-ASCII char when splitting parts by charset.
-             (= n8bit 1))
-         'quoted-printable
-       'base64))))
+  (if (equal mm-use-ultra-safe-encoding '(sign . "pgp"))
+      ;; perhaps not always accurate?
+      'quoted-printable
+    (save-excursion
+      (let ((limit (min (point-max) (+ 2000 (point-min))))
+           (n8bit 0))
+       (goto-char (point-min))
+       (skip-chars-forward "\x20-\x7f\r\n\t" limit)
+       (while (< (point) limit)
+         (incf n8bit)
+         (forward-char 1)
+         (skip-chars-forward "\x20-\x7f\r\n\t" limit))
+       (if (or (< (* 6 n8bit) (- limit (point-min)))
+               ;; Don't base64, say, a short line with a single
+               ;; non-ASCII char when splitting parts by charset.
+               (= n8bit 1))
+           'quoted-printable
+         'base64)))))
 
 (provide 'mm-encode)