(let ((args (list "--with-colons" "--no-greeting" "--batch"
(if all "--list-secret-keys" "--list-keys")
string))
- (key-regexp (concat "^\\(sec\\|pub\\)"
- ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*"
- ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):"))
- )
+ (key-regexp (concat "^\\(sec\\|pub\\)"
+ ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*"
+ ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):")))
(with-temp-buffer
(apply #'call-process pgg-gpg-program nil t nil args)
(goto-char (point-min))
(if (re-search-forward key-regexp
- nil t)
- (match-string 3)))))
+ nil t)
+ (match-string 3)))))
(defun pgg-gpg-key-id-from-key-owner (key-owner)
(cond ((not key-owner) nil)
- ;; Extract bare key id from outermost paired angle brackets, if any:
- ((string-match "[^<]*<\\(.+\\)>[^>]*" key-owner)
- (substring key-owner (match-beginning 1)(match-end 1)))
- (key-owner))
- )
+ ;; Extract bare key id from outermost paired angle brackets, if any:
+ ((string-match "[^<]*<\\(.+\\)>[^>]*" key-owner)
+ (substring key-owner (match-beginning 1)(match-end 1)))
+ (key-owner)))
(defun pgg-gpg-encrypt-region (start end recipients &optional sign passphrase)
"Encrypt the current region between START and END.
(insert-buffer-substring current-buffer)
(pgg-decode-armor-region (point-min) (point-max))))
(secret-keys (pgg-gpg-lookup-all-secret-keys))
- ;; XXX the user is stuck if they need to use the passphrase for
- ;; any but the first secret key for which the message is
- ;; encrypted. ideally, we would incrementally give them a
- ;; chance with subsequent keys each time they fail with one.
+ ;; XXX the user is stuck if they need to use the passphrase for
+ ;; any but the first secret key for which the message is
+ ;; encrypted. ideally, we would incrementally give them a
+ ;; chance with subsequent keys each time they fail with one.
(key (pgg-gpg-select-matching-key message-keys secret-keys))
- (key-owner (and key (pgg-gpg-lookup-key-owner key t)))
+ (key-owner (and key (pgg-gpg-lookup-key-owner key t)))
(key-id (pgg-gpg-key-id-from-key-owner key-owner))
(pgg-gpg-user-id (or key-id key
- pgg-gpg-user-id pgg-default-user-id))
+ pgg-gpg-user-id pgg-default-user-id))
(passphrase (or passphrase
(when (not pgg-gpg-use-agent)
(pgg-read-passphrase
(loop for message-key in message-keys
for message-key-id = (and (equal (car message-key) 1)
(cdr (assq 'key-identifier
- (cdr message-key))))
+ (cdr message-key))))
for key = (and message-key-id (pgg-lookup-key message-key-id 'encrypt))
when (and key (member key secret-keys)) return key))