emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master ddd0ead: Suppress redundant Pinentry startup messag


From: Daiki Ueno
Subject: [Emacs-diffs] master ddd0ead: Suppress redundant Pinentry startup messages
Date: Fri, 06 Nov 2015 01:57:17 +0000

branch: master
commit ddd0eada666c48906341ef57e3385e5faf92989c
Author: Daiki Ueno <address@hidden>
Commit: Daiki Ueno <address@hidden>

    Suppress redundant Pinentry startup messages
    
    * lisp/net/pinentry.el (pinentry-start): Add optional QUIET
    argument.
    * lisp/epg.el: Declare `pinentry-start'.
    (epg--start): Call `pinentry-start' with QUIET argument set.
---
 lisp/epg.el          |    4 +++-
 lisp/net/pinentry.el |   10 +++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/epg.el b/lisp/epg.el
index aa79c7d..71a83c3 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -551,6 +551,8 @@ callback data (if any)."
 (defun epg-errors-to-string (errors)
   (mapconcat #'epg-error-to-string errors "; "))
 
+(declare-function pinentry-start "pinentry" (&optional quiet))
+
 (defun epg--start (context args)
   "Start `epg-gpg-program' in a subprocess with given ARGS."
   (if (and (epg-context-process context)
@@ -614,7 +616,7 @@ callback data (if any)."
                   (re-search-forward
                     "^allow-emacs-pinentry:\\(?:.*:\\)\\{8\\}1"
                     nil t))))
-      (pinentry-start))
+      (pinentry-start 'quiet))
     (setq process-environment
          (cons (format "INSIDE_EMACS=%s,epg" emacs-version)
                process-environment))
diff --git a/lisp/net/pinentry.el b/lisp/net/pinentry.el
index eaa9fa4..0037006 100644
--- a/lisp/net/pinentry.el
+++ b/lisp/net/pinentry.el
@@ -151,16 +151,20 @@ If local sockets are not supported, this is nil.")
       (apply query-function (concat desc "\n" prompt) query-args))))
 
 ;;;###autoload
-(defun pinentry-start ()
+(defun pinentry-start (&optional quiet)
   "Start a Pinentry service.
 
 Once the environment is properly set, subsequent invocations of
-the gpg command will interact with Emacs for passphrase input."
+the gpg command will interact with Emacs for passphrase input.
+
+If the optional QUIET argument is non-nil, messages at startup
+will not be shown."
   (interactive)
   (unless (featurep 'make-network-process '(:family local))
     (error "local sockets are not supported"))
   (if (process-live-p pinentry--server-process)
-      (message "Pinentry service is already running")
+      (unless quiet
+        (message "Pinentry service is already running"))
     (let* ((server-file (expand-file-name "pinentry" pinentry--socket-dir)))
       (server-ensure-safe-dir pinentry--socket-dir)
       ;; Delete the socket files made by previous server invocations.



reply via email to

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