--- mm-encode.el- Tue Sep 21 17:41:18 1999 +++ mm-encode.el Tue Sep 21 17:51:29 1999 @@ -126,24 +126,17 @@ (defun mm-qp-or-base64 () (save-excursion - (save-restriction - (narrow-to-region (point-min) (min (+ (point-min) 1000) (point-max))) + (let ((limit (min (point-max) (+ 2000 (point-min)))) + (n8bit 0)) (goto-char (point-min)) - (let ((8bit 0)) - (cond - ((not (featurep 'mule)) - (while (re-search-forward "[^\x20-\x7f\r\n\t]" nil t) - (incf 8bit))) - (t - ;; Mule version - (while (not (eobp)) - (skip-chars-forward "\x20-\x7f\r\n\t") - (unless (eobp) - (forward-char 1) - (incf 8bit))))) - (if (> (/ (* 8bit 1.0) (buffer-size)) 0.166) - 'base64 - 'quoted-printable))))) + (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 (< (* 6 n8bit) (- limit (point-min))) + 'quoted-printable + 'base64)))) (provide 'mm-encode)