(interactive "fFile: ")
(let ((context (epg-make-context)))
(message "Importing %s..." (file-name-nondirectory file))
- (epg-import-keys-from-file context (expand-file-name file))
- (message "Importing %s...done" (file-name-nondirectory file))
+ (condition-case nil
+ (progn
+ (epg-import-keys-from-file context (expand-file-name file))
+ (message "Importing %s...done" (file-name-nondirectory file)))
+ (error
+ (message "Importing %s...failed" (file-name-nondirectory file))))
(if (epg-context-result-for context 'import)
(epa-display-info (epg-import-result-to-string
(epg-context-result-for context 'import))))))
\\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\)" string)
(epg-context-set-result-for
context 'import
- (cons (epg-make-import-result
- (string-to-number (match-string 1 string))
- (string-to-number (match-string 2 string))
- (string-to-number (match-string 3 string))
- (string-to-number (match-string 4 string))
- (string-to-number (match-string 5 string))
- (string-to-number (match-string 6 string))
- (string-to-number (match-string 7 string))
- (string-to-number (match-string 8 string))
- (string-to-number (match-string 9 string))
- (string-to-number (match-string 10 string))
- (string-to-number (match-string 11 string))
- (string-to-number (match-string 12 string))
- (string-to-number (match-string 13 string))
- (epg-context-result-for context 'import-status))
- (epg-context-result-for context 'import)))
+ (epg-make-import-result (string-to-number (match-string 1 string))
+ (string-to-number (match-string 2 string))
+ (string-to-number (match-string 3 string))
+ (string-to-number (match-string 4 string))
+ (string-to-number (match-string 5 string))
+ (string-to-number (match-string 6 string))
+ (string-to-number (match-string 7 string))
+ (string-to-number (match-string 8 string))
+ (string-to-number (match-string 9 string))
+ (string-to-number (match-string 10 string))
+ (string-to-number (match-string 11 string))
+ (string-to-number (match-string 12 string))
+ (string-to-number (match-string 13 string))
+ (epg-context-result-for context 'import-status)))
(epg-context-set-result-for context 'import-status nil)))
(defun epg-passphrase-callback-function (context key-id handback)