changeset 69646:38f28026dd63

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.
author Simon Josefsson <jas@extundo.com>
date Thu, 23 Mar 2006 13:13:27 +0000
parents 367a30fbed4e
children e78140e0c24a
files lisp/ChangeLog lisp/pgg-gpg.el
diffstat 2 files changed, 21 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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  <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.
+
 2006-03-23  Romain Francoise  <romain@orebokech.com>
 
 	* ibuf-ext.el (ibuffer-read-filter-group-name):
--- 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."