Mercurial > emacs
changeset 69627:497d0ade32a5
Sync with version from Gnus (only whitespace changes).
author | Reiner Steib <Reiner.Steib@gmx.de> |
---|---|
date | Tue, 21 Mar 2006 21:24:27 +0000 |
parents | f7d076c76ddc |
children | 83bcc21a8e89 |
files | lisp/pgg-gpg.el |
diffstat | 1 files changed, 16 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/pgg-gpg.el Tue Mar 21 21:17:32 2006 +0000 +++ b/lisp/pgg-gpg.el Tue Mar 21 21:24:27 2006 +0000 @@ -163,24 +163,22 @@ (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. @@ -242,15 +240,15 @@ (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 @@ -280,7 +278,7 @@ (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))