diff options
author | Simon Josefsson <jas@extundo.com> | 2006-03-23 13:13:27 +0000 |
---|---|---|
committer | Simon Josefsson <jas@extundo.com> | 2006-03-23 13:13:27 +0000 |
commit | de82e530c76953beb4edadf1261205b290fae284 (patch) | |
tree | aff095fa0f0a9d04f62b14637554a9bb22dabbd2 /lisp/pgg-gpg.el | |
parent | 4f162824e5a04baf549c0b0bc4bd248c4e05b3e8 (diff) | |
download | emacs-de82e530c76953beb4edadf1261205b290fae284.tar.gz |
2006-03-23 Reiner Steib <reinersteib+gmane@imap.cc>
* pgg-gpg.el (pgg-gpg-update-agent): Check for
make-network-process, so we can use the same code in Gnus v5-10
too and have this file fully synchronized with that release.
Diffstat (limited to 'lisp/pgg-gpg.el')
-rw-r--r-- | lisp/pgg-gpg.el | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/lisp/pgg-gpg.el b/lisp/pgg-gpg.el index eefc569fd04..ab91471a619 100644 --- a/lisp/pgg-gpg.el +++ b/lisp/pgg-gpg.el @@ -358,18 +358,21 @@ passphrase cache or user." (defun pgg-gpg-update-agent () "Try to connet to gpg-agent and send UPDATESTARTUPTTY." - (let* ((agent-info (getenv "GPG_AGENT_INFO")) - (socket (and agent-info - (string-match "^\\([^:]*\\)" agent-info) - (match-string 1 agent-info))) - (conn (and socket - (make-network-process :name "gpg-agent-process" - :host 'local :family 'local - :service socket)))) - (when (and conn (eq (process-status conn) 'open)) - (process-send-string conn "UPDATESTARTUPTTY\n") - (delete-process conn) - t))) + (if (fboundp 'make-network-process) + (let* ((agent-info (getenv "GPG_AGENT_INFO")) + (socket (and agent-info + (string-match "^\\([^:]*\\)" agent-info) + (match-string 1 agent-info))) + (conn (and socket + (make-network-process :name "gpg-agent-process" + :host 'local :family 'local + :service socket)))) + (when (and conn (eq (process-status conn) 'open)) + (process-send-string conn "UPDATESTARTUPTTY\n") + (delete-process conn) + t)) + ;; We can't check, so assume gpg-agent is up. + t)) (defun pgg-gpg-use-agent-p () "Return t if `pgg-gpg-use-agent' is t and gpg-agent is available." |