emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/pgg-gpg.el


From: Simon Josefsson
Subject: [Emacs-diffs] Changes to emacs/lisp/pgg-gpg.el
Date: Thu, 23 Mar 2006 13:13:29 +0000

Index: emacs/lisp/pgg-gpg.el
diff -u emacs/lisp/pgg-gpg.el:1.7 emacs/lisp/pgg-gpg.el:1.8
--- emacs/lisp/pgg-gpg.el:1.7   Wed Mar 22 16:09:16 2006
+++ emacs/lisp/pgg-gpg.el       Thu Mar 23 13:13:27 2006
@@ -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."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]