this fixes the quoted-printable or base64 selector function in mm-encode.el. the pgnus-0.96 function is totally broken. the new improved function is (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 (< (* 6 n8bit) (- limit (point-min))) 'quoted-printable 'base64)))) which fixes the following problems with the old function. * long attachments are always quoted-printable the old function used narrow to limit to 1000 chars and then compared number of 8 bit chars divided by the buffer-size to 0.1667. buffer-size is the complete non-narrowed buffer which causes quoted-printable to always be chosen for long attachments. * empty attachment causes divide by zero. * distinction between multibyte and non-multibyte. imho this just added complexity and maintainance headaches without buying any useful performance. * gratuitous usage of floating point.