X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmml1991.el;h=50daea817c0ac07fc3073cac5b48ea8643894bed;hb=fda35d24e5e03efcf8f47ae389be22647eb53719;hp=8ec52bd8673816b71fddfc8a796e0fda6a48abb2;hpb=6a99d5263c1f649441e1509f2d8d3eb028192f03;p=gnus diff --git a/lisp/mml1991.el b/lisp/mml1991.el index 8ec52bd86..50daea817 100644 --- a/lisp/mml1991.el +++ b/lisp/mml1991.el @@ -242,24 +242,29 @@ (pop-to-buffer pgg-errors-buffer) (error "Encrypt error")) (delete-region (point-min) (point-max)) - (insert-buffer-substring pgg-output-buffer) - (goto-char (point-min)) - (while (re-search-forward "\r+$" nil t) - (replace-match "" t t)) - (mm-encode-content-transfer-encoding cte) - (goto-char (point-min)) - (when headers - (insert headers)) - (insert "\n") + (mm-with-unibyte-current-buffer + (insert-buffer-substring pgg-output-buffer) + (goto-char (point-min)) + (while (re-search-forward "\r+$" nil t) + (replace-match "" t t)) + (mm-encode-content-transfer-encoding cte) + (goto-char (point-min)) + (when headers + (insert headers)) + (insert "\n")) t)) (defun mml1991-pgg-encrypt (cont &optional sign) - (let (headers) + (let (cte) ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED (goto-char (point-min)) - (while (looking-at "^Content[^ ]+:") (forward-line)) + (while (looking-at "^Content[^ ]+:") + (when (looking-at "^Content-Transfer-Encoding: \\(.+\\)") + (setq cte (intern (match-string 1)))) + (forward-line)) (unless (bobp) (delete-region (point-min) (point))) + (mm-decode-content-transfer-encoding cte) (unless (pgg-encrypt-region (point-min) (point-max) (split-string