]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/mml2015.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / gnus / mml2015.el
index e2e99771801c1031904c3e039b4dd17f1bb4e3ad..309f1a77ff0004577bd9d70909be0af052cb1525 100644 (file)
@@ -487,14 +487,17 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
                        (or (y-or-n-p "Sign the message? ")
                            'not))))
             'never)))
-    (mm-with-unibyte-current-buffer
-      (mc-encrypt-generic
-       (or (message-options-get 'message-recipients)
-          (message-options-set 'message-recipients
-                             (mc-cleanup-recipient-headers
-                              (read-string "Recipients: "))))
-       nil nil nil
-       (message-options-get 'message-sender))))
+    (insert
+     (with-temp-buffer
+       (set-buffer-multibyte nil)
+       (mc-encrypt-generic
+       (or (message-options-get 'message-recipients)
+           (message-options-set 'message-recipients
+                                (mc-cleanup-recipient-headers
+                                 (read-string "Recipients: "))))
+       nil nil nil
+       (message-options-get 'message-sender))
+       (buffer-string))))
   (goto-char (point-min))
   (unless (looking-at "-----BEGIN PGP MESSAGE-----")
     (error "Fail to encrypt the message"))
@@ -619,7 +622,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
            (insert "\r"))
          (forward-line)
          (end-of-line))
-       (with-temp-file (setq signature-file (mm-make-temp-file "pgg"))
+       (with-temp-file (setq signature-file (make-temp-file "pgg"))
          (mm-insert-part signature))
        (if (condition-case err
                (prog1
@@ -660,7 +663,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
     (if (condition-case err
            (prog1
                (mm-with-unibyte-buffer
-                 (insert (mm-encode-coding-string text coding-system))
+                 (insert (encode-coding-string text coding-system))
                  (pgg-verify-region (point-min) (point-max) nil t))
              (goto-char (point-min))
              (while (search-forward "\r\n" nil t)
@@ -780,12 +783,10 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
 (autoload 'epg-expand-group "epg-config")
 (autoload 'epa-select-keys "epa")
 
-(autoload 'gnus-create-image "gnus-ems")
-
 (defun mml2015-epg-key-image (key-id)
   "Return the image of a key, if any"
   (with-temp-buffer
-    (mm-set-buffer-multibyte nil)
+    (set-buffer-multibyte nil)
     (let* ((coding-system-for-write 'binary)
            (coding-system-for-read 'binary)
            (data (shell-command-to-string
@@ -925,7 +926,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
        (mm-set-handle-multipart-parameter
         mm-security-handle 'gnus-info "Corrupted")
        (throw 'error handle))
-      (setq part (mm-replace-in-string part "\n" "\r\n")
+      (setq part (replace-regexp-in-string "\n" "\r\n" part)
            signature (mm-get-part signature)
            context (epg-make-context))
       (condition-case error
@@ -948,8 +949,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
 (defun mml2015-epg-clear-verify ()
   (let ((inhibit-redisplay t)
        (context (epg-make-context))
-       (signature (mm-encode-coding-string (buffer-string)
-                                           coding-system-for-write))
+       (signature (encode-coding-string (buffer-string)
+                                        coding-system-for-write))
        plain)
     (condition-case error
        (setq plain (epg-verify-string context signature))
@@ -968,7 +969,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
           (mml2015-epg-verify-result-to-string
            (epg-context-result-for context 'verify)))
          (delete-region (point-min) (point-max))
-         (insert (mm-decode-coding-string plain coding-system-for-read)))
+         (insert (decode-coding-string plain coding-system-for-read)))
       (mml2015-extract-cleartext-signature))))
 
 (defun mml2015-epg-sign (cont)