* epg.el (epg-sign-file): Signal an error only when a signature is not
[elisp/epg.git] / epa-file.el
index efd44fc..435976c 100644 (file)
        (setq string
              (epg-encrypt-string
               context
-              (encode-coding-string (buffer-string) coding-system)
-              (mapcar (lambda (key)
-                        (epg-sub-key-id (car (epg-key-sub-key-list key))))
-                      (unless (assoc file epa-file-passphrase-alist)
+              (if (stringp start)
+                  (encode-coding-string start coding-system)
+                (encode-coding-string (buffer-substring start end)
+                                      coding-system))
+              (unless (assoc file epa-file-passphrase-alist)
                         (epa-select-keys
-                   "Select recipents for encryption.
-If no one is selected, symmetric encryption will be performed.  ")))))
+                         context
+                         "Select recipents for encryption.
+If no one is selected, symmetric encryption will be performed.  "))))
       (error
        (if (setq entry (assoc file epa-file-passphrase-alist))
           (setcdr entry nil))