(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)
(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))
(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.