# HG changeset patch # User Simon Josefsson # Date 1143119607 0 # Node ID 38f28026dd6316984d9a39f9675a676634521a99 # Parent 367a30fbed4e2a0115a74503cfbb2afa6b95c0c7 2006-03-23 Reiner Steib * 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. diff -r 367a30fbed4e -r 38f28026dd63 lisp/ChangeLog --- a/lisp/ChangeLog Thu Mar 23 11:30:48 2006 +0000 +++ b/lisp/ChangeLog Thu Mar 23 13:13:27 2006 +0000 @@ -1,3 +1,9 @@ +2006-03-23 Reiner Steib + + * 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. + 2006-03-23 Romain Francoise * ibuf-ext.el (ibuffer-read-filter-group-name): diff -r 367a30fbed4e -r 38f28026dd63 lisp/pgg-gpg.el --- a/lisp/pgg-gpg.el Thu Mar 23 11:30:48 2006 +0000 +++ b/lisp/pgg-gpg.el Thu Mar 23 13:13:27 2006 +0000 @@ -358,18 +358,21 @@ (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."