]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/mml-smime.el
Clean up nnimap-request-move-article slightly
[gnu-emacs] / lisp / gnus / mml-smime.el
index 2d8f25c500375499583c0485653bf409224e21a2..02e602ce77fc133822ec80462e280e2fff7e8e6b 100644 (file)
@@ -149,8 +149,7 @@ Whether the passphrase is cached at all is controlled by
       (if (not (and (not (file-exists-p tmp))
                    (get-buffer tmp)))
          (push tmp certfiles)
-       (setq file (mm-make-temp-file (expand-file-name "mml."
-                                                       mm-tmp-directory)))
+       (setq file (make-temp-file (expand-file-name "mml." mm-tmp-directory)))
        (with-current-buffer tmp
          (write-region (point-min) (point-max) file))
        (push file certfiles)
@@ -176,15 +175,12 @@ Whether the passphrase is cached at all is controlled by
   (list 'keyfile
        (if (= (length smime-keys) 1)
            (cadar smime-keys)
-         (or (let ((from (cadr (funcall (if (boundp
-                                             'gnus-extract-address-components)
-                                            gnus-extract-address-components
-                                          'mail-extract-address-components)
-                                        (or (save-excursion
-                                              (save-restriction
-                                                (message-narrow-to-headers)
-                                                (message-fetch-field "from")))
-                                            "")))))
+         (or (let ((from (cadr (mail-extract-address-components
+                                (or (save-excursion
+                                      (save-restriction
+                                        (message-narrow-to-headers)
+                                        (message-fetch-field "from")))
+                                    "")))))
                (and from (smime-get-key-by-email from)))
              (smime-get-key-by-email
               (gnus-completing-read "Sign this part with what signature"
@@ -205,18 +201,15 @@ Whether the passphrase is cached at all is controlled by
        (while (not result)
          (setq who (read-from-minibuffer
                     (format "%sLookup certificate for: " (or bad ""))
-                    (cadr (funcall (if (boundp
-                                        'gnus-extract-address-components)
-                                       gnus-extract-address-components
-                                     'mail-extract-address-components)
-                                   (or (save-excursion
-                                         (save-restriction
-                                           (message-narrow-to-headers)
-                                           (message-fetch-field "to")))
-                                       "")))))
+                    (cadr (mail-extract-address-components
+                           (or (save-excursion
+                                 (save-restriction
+                                   (message-narrow-to-headers)
+                                   (message-fetch-field "to")))
+                               "")))))
          (if (setq cert (smime-cert-by-dns who))
              (setq result (list 'certfile (buffer-name cert)))
-           (setq bad (format "`%s' not found. " who))))
+           (setq bad (format-message "`%s' not found. " who))))
       (quit))
     result))
 
@@ -235,7 +228,7 @@ Whether the passphrase is cached at all is controlled by
                                        "")))))
          (if (setq cert (smime-cert-by-ldap who))
              (setq result (list 'certfile (buffer-name cert)))
-           (setq bad (format "`%s' not found. " who))))
+           (setq bad (format-message "`%s' not found. " who))))
       (quit))
     result))
 
@@ -425,7 +418,7 @@ Content-Disposition: attachment; filename=smime.p7m
        (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)
            context (epg-make-context 'CMS))
       (condition-case error
          (setq plain (epg-verify-string context (mm-get-part signature) part))