--- mm-encode.el.orig Wed Sep 22 11:31:49 1999 +++ mm-encode.el Wed Sep 22 11:32:41 1999 @@ -126,10 +126,12 @@ (defun mm-qp-or-base64 () (save-excursion - (save-restriction - (narrow-to-region (point-min) (min (+ (point-min) 1000) (point-max))) - (goto-char (point-min)) - (let ((8bit 0)) + (let ((8bit 0) + (start (point-min)) + (end (min (+ (point-min) 1000) (point-max)))) + (narrow-to-region start end) + (goto-char start) + (save-restriction (cond ((not (featurep 'mule)) (while (re-search-forward "[^\x20-\x7f\r\n\t]" nil t) @@ -141,9 +143,9 @@ (unless (eobp) (forward-char 1) (incf 8bit))))) - (if (> (/ (* 8bit 1.0) (buffer-size)) 0.166) + (if (> (/ (* 8bit 1.0) (- end start)) 0.166) 'base64 - 'quoted-printable))))) + 'quoted-printable))))) (provide 'mm-encode)