From 745442780db34df01f5dda5d538bb3cf3ece3f0f Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 25 Dec 2003 21:58:25 +0000 Subject: [PATCH] Synch to Gnus 200312251717. --- lisp/ChangeLog | 5 +++++ lisp/mml1991.el | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c0dec97..0f0ce41 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2003-12-25 Jesper Harder + + * mml1991.el (mml1991-pgg-sign): Encode and decode according to + CTE header. Don't insert gpg output as unibyte. + 2003-12-25 Katsumi Yamaoka * lpath.el: Remove display-time-event-handler and open-ssl-stream; diff --git a/lisp/mml1991.el b/lisp/mml1991.el index cf55c4c..b1cfbb7 100644 --- a/lisp/mml1991.el +++ b/lisp/mml1991.el @@ -223,7 +223,7 @@ (defvar pgg-errors-buffer) (defun mml1991-pgg-sign (cont) - (let (headers) + (let (headers cte) ;; Don't sign headers. (goto-char (point-min)) (while (not (looking-at "^$")) @@ -232,7 +232,9 @@ (setq headers (buffer-substring (point-min) (point))) (forward-line) ;; skip header/body separator (delete-region (point-min) (point))) - (quoted-printable-decode-region (point-min) (point-max)) + (when (string-match "^Content-Transfer-Encoding: \\(.+\\)" headers) + (setq cte (intern (match-string 1 headers)))) + (mm-decode-content-transfer-encoding cte) (unless (let ((pgg-default-user-id (or (message-options-get 'mml-sender) pgg-default-user-id))) @@ -240,14 +242,14 @@ (pop-to-buffer pgg-errors-buffer) (error "Encrypt error")) (delete-region (point-min) (point-max)) - (mm-with-unibyte-current-buffer - (insert-buffer-substring pgg-output-buffer)) + (insert-buffer-substring pgg-output-buffer) (goto-char (point-min)) (while (re-search-forward "\r+$" nil t) (replace-match "" t t)) - (quoted-printable-encode-region (point-min) (point-max)) + (mm-encode-content-transfer-encoding cte) (goto-char (point-min)) - (if headers (insert headers)) + (when headers + (insert headers)) (insert "\n") t)) -- 1.7.10.4