From bd0abc9cab7d8843ed46571f52ec364cf38701b0 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sun, 28 Dec 2003 00:51:11 +0000 Subject: [PATCH] Synch to Gnus 200312272353. --- lisp/ChangeLog | 11 +++++++++++ lisp/mml1991.el | 27 ++++++++++++++++----------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a69d4c8..2d4190a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2003-12-28 Jesper Harder + + * mml1991.el (mml1991-pgg-encrypt): Decode according to CTE before + encrypting. + +2003-12-28 Jesper Harder + + * mml1991.el (mml1991-pgg-sign): Use unibyte when re-encoding. + From Ivan Boldyrev (tiny change). + + 2003-12-26 Katsumi Yamaoka * dgnushack.el: Add an advice to byte-optimize-form-code-walker to diff --git a/lisp/mml1991.el b/lisp/mml1991.el index b1cfbb7..dbd980b 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 -- 1.7.10.4