From 09dd0c22744903b2735e0f462914d51ffd6bf585 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Sat, 25 Jan 2003 19:37:26 +0000 Subject: [PATCH] (mm-qp-or-base64): Always QP iff mm-use-ultra-safe-encoding and cleartext PGP. --- lisp/ChangeLog | 3 +++ lisp/mm-encode.el | 33 ++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 84957cef6..e27a50528 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2003-01-25 Simon Josefsson + * 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). diff --git a/lisp/mm-encode.el b/lisp/mm-encode.el index c315c61e4..1da3dc659 100644 --- a/lisp/mm-encode.el +++ b/lisp/mm-encode.el @@ -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) -- 2.34.1