Synch to Gnus 200312272353.
authoryamaoka <yamaoka>
Sun, 28 Dec 2003 00:51:11 +0000 (00:51 +0000)
committeryamaoka <yamaoka>
Sun, 28 Dec 2003 00:51:11 +0000 (00:51 +0000)
lisp/ChangeLog
lisp/mml1991.el

index a69d4c8..2d4190a 100644 (file)
@@ -1,3 +1,14 @@
+2003-12-28  Jesper Harder  <harder@ifa.au.dk>
+
+       * mml1991.el (mml1991-pgg-encrypt): Decode according to CTE before
+       encrypting.
+
+2003-12-28  Jesper Harder  <harder@ifa.au.dk>
+
+       * mml1991.el (mml1991-pgg-sign): Use unibyte when re-encoding.
+       From Ivan Boldyrev <boldyrev@uiggm.nsc.ru> (tiny change).
+
+
 2003-12-26  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * dgnushack.el: Add an advice to byte-optimize-form-code-walker to
index b1cfbb7..dbd980b 100644 (file)
       (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