diff options
| author | Daiki Ueno | 2015-11-06 10:28:36 +0900 |
|---|---|---|
| committer | Daiki Ueno | 2015-11-06 10:56:49 +0900 |
| commit | ddd0eada666c48906341ef57e3385e5faf92989c (patch) | |
| tree | d6e091f7bb8860facfd908b6b40b5444a2337f5d | |
| parent | 8311d3929a4ebd1684f11e3e97c25b4152d40679 (diff) | |
| download | emacs-ddd0eada666c48906341ef57e3385e5faf92989c.tar.gz emacs-ddd0eada666c48906341ef57e3385e5faf92989c.zip | |
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.
| -rw-r--r-- | lisp/epg.el | 4 | ||||
| -rw-r--r-- | lisp/net/pinentry.el | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/epg.el b/lisp/epg.el index aa79c7d0fc2..71a83c3c670 100644 --- a/lisp/epg.el +++ b/lisp/epg.el | |||
| @@ -551,6 +551,8 @@ callback data (if any)." | |||
| 551 | (defun epg-errors-to-string (errors) | 551 | (defun epg-errors-to-string (errors) |
| 552 | (mapconcat #'epg-error-to-string errors "; ")) | 552 | (mapconcat #'epg-error-to-string errors "; ")) |
| 553 | 553 | ||
| 554 | (declare-function pinentry-start "pinentry" (&optional quiet)) | ||
| 555 | |||
| 554 | (defun epg--start (context args) | 556 | (defun epg--start (context args) |
| 555 | "Start `epg-gpg-program' in a subprocess with given ARGS." | 557 | "Start `epg-gpg-program' in a subprocess with given ARGS." |
| 556 | (if (and (epg-context-process context) | 558 | (if (and (epg-context-process context) |
| @@ -614,7 +616,7 @@ callback data (if any)." | |||
| 614 | (re-search-forward | 616 | (re-search-forward |
| 615 | "^allow-emacs-pinentry:\\(?:.*:\\)\\{8\\}1" | 617 | "^allow-emacs-pinentry:\\(?:.*:\\)\\{8\\}1" |
| 616 | nil t)))) | 618 | nil t)))) |
| 617 | (pinentry-start)) | 619 | (pinentry-start 'quiet)) |
| 618 | (setq process-environment | 620 | (setq process-environment |
| 619 | (cons (format "INSIDE_EMACS=%s,epg" emacs-version) | 621 | (cons (format "INSIDE_EMACS=%s,epg" emacs-version) |
| 620 | process-environment)) | 622 | process-environment)) |
diff --git a/lisp/net/pinentry.el b/lisp/net/pinentry.el index eaa9fa40b12..0037006f40a 100644 --- a/lisp/net/pinentry.el +++ b/lisp/net/pinentry.el | |||
| @@ -151,16 +151,20 @@ If local sockets are not supported, this is nil.") | |||
| 151 | (apply query-function (concat desc "\n" prompt) query-args)))) | 151 | (apply query-function (concat desc "\n" prompt) query-args)))) |
| 152 | 152 | ||
| 153 | ;;;###autoload | 153 | ;;;###autoload |
| 154 | (defun pinentry-start () | 154 | (defun pinentry-start (&optional quiet) |
| 155 | "Start a Pinentry service. | 155 | "Start a Pinentry service. |
| 156 | 156 | ||
| 157 | Once the environment is properly set, subsequent invocations of | 157 | Once the environment is properly set, subsequent invocations of |
| 158 | the gpg command will interact with Emacs for passphrase input." | 158 | the gpg command will interact with Emacs for passphrase input. |
| 159 | |||
| 160 | If the optional QUIET argument is non-nil, messages at startup | ||
| 161 | will not be shown." | ||
| 159 | (interactive) | 162 | (interactive) |
| 160 | (unless (featurep 'make-network-process '(:family local)) | 163 | (unless (featurep 'make-network-process '(:family local)) |
| 161 | (error "local sockets are not supported")) | 164 | (error "local sockets are not supported")) |
| 162 | (if (process-live-p pinentry--server-process) | 165 | (if (process-live-p pinentry--server-process) |
| 163 | (message "Pinentry service is already running") | 166 | (unless quiet |
| 167 | (message "Pinentry service is already running")) | ||
| 164 | (let* ((server-file (expand-file-name "pinentry" pinentry--socket-dir))) | 168 | (let* ((server-file (expand-file-name "pinentry" pinentry--socket-dir))) |
| 165 | (server-ensure-safe-dir pinentry--socket-dir) | 169 | (server-ensure-safe-dir pinentry--socket-dir) |
| 166 | ;; Delete the socket files made by previous server invocations. | 170 | ;; Delete the socket files made by previous server invocations. |