Move epa-pinentry-mode to epg-config (Bug#26298)

* lisp/epa.el (epa-pinentry-mode): Make into obsolete alias for...
* lisp/epg-config.el (epg-pinentry-mode): ...this new user option.
* lisp/epg.el (epg-context): Use it as the default value for
pinentry-mode.
* etc/NEWS: Announce name change.

* lisp/epa-file.el (epa-file-insert-file-contents)
(epa-file-write-region):
* lisp/epa.el (epa-decrypt-file, epa-sign-file)
(epa-encrypt-file, epa-decrypt-region)
(epa-sign-region, epa-encrypt-region): Don't change
epg-context-pinentry-mode from the default.
This commit is contained in:
Noam Postavsky 2018-04-29 10:32:03 -04:00
parent 21ab346a07
commit 302e500087
5 changed files with 27 additions and 31 deletions

View file

@ -453,6 +453,9 @@ are formatted as MIME digests.
*** 'message-forward-included-headers' has changed its default to
exclude most headers when forwarding.
** 'epa-pinentry-mode' is renamed to 'epg-pinentry-mode'.
It now applies to epg functions as well as epa functions.
* New Modes and Packages in Emacs 27.1
+++

View file

@ -147,7 +147,6 @@ encryption is used."
context
(cons #'epa-progress-callback-function
(format "Decrypting %s" file)))
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(unwind-protect
(progn
(if replace
@ -236,7 +235,6 @@ encryption is used."
(cons #'epa-progress-callback-function
(format "Encrypting %s" file)))
(setf (epg-context-armor context) epa-armor)
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(condition-case error
(setq string
(epg-encrypt-string

View file

@ -56,27 +56,8 @@ If neither t nor nil, ask user for confirmation."
:type 'integer
:group 'epa)
;; In the doc string below, we say "symbol `error'" to avoid producing
;; a hyperlink for `error' the function.
(defcustom epa-pinentry-mode nil
"The pinentry mode.
GnuPG 2.1 or later has an option to control the behavior of
Pinentry invocation. The value should be the symbol `error',
`ask', `cancel', or `loopback'. See the GnuPG manual for the
meanings.
In epa commands, a particularly useful mode is `loopback', which
redirects all Pinentry queries to the caller, so Emacs can query
passphrase through the minibuffer, instead of external Pinentry
program."
:type '(choice (const nil)
(const ask)
(const cancel)
(const error)
(const loopback))
:group 'epa
:version "25.1")
(define-obsolete-variable-alias
'epa-pinentry-mode 'epg-pinentry-mode "27.1")
(defgroup epa-faces nil
"Faces for epa-mode."
@ -695,7 +676,6 @@ If you do not specify PLAIN-FILE, this functions prompts for the value to use."
#'epa-progress-callback-function
(format "Decrypting %s..."
(file-name-nondirectory decrypt-file))))
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Decrypting %s..." (file-name-nondirectory decrypt-file))
(condition-case error
(epg-decrypt-file context decrypt-file plain-file)
@ -791,7 +771,6 @@ If no one is selected, default secret key is used. "
#'epa-progress-callback-function
(format "Signing %s..."
(file-name-nondirectory file))))
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Signing %s..." (file-name-nondirectory file))
(condition-case error
(epg-sign-file context file signature mode)
@ -822,7 +801,6 @@ If no one is selected, symmetric encryption will be performed. ")))
#'epa-progress-callback-function
(format "Encrypting %s..."
(file-name-nondirectory file))))
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Encrypting %s..." (file-name-nondirectory file))
(condition-case error
(epg-encrypt-file context file recipients cipher)
@ -865,7 +843,6 @@ For example:
(cons
#'epa-progress-callback-function
"Decrypting..."))
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Decrypting...")
(condition-case error
(setq plain (epg-decrypt-string context (buffer-substring start end)))
@ -1070,7 +1047,6 @@ If no one is selected, default secret key is used. "
(cons
#'epa-progress-callback-function
"Signing..."))
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Signing...")
(condition-case error
(setq signature (epg-sign-string context
@ -1159,7 +1135,6 @@ If no one is selected, symmetric encryption will be performed. ")
(cons
#'epa-progress-callback-function
"Encrypting..."))
(setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Encrypting...")
(condition-case error
(setq cipher (epg-encrypt-string context
@ -1328,7 +1303,6 @@ If no one is selected, default public key is exported. ")))
;; (cons
;; #'epa-progress-callback-function
;; "Signing keys..."))
;; (setf (epg-context-pinentry-mode context) epa-pinentry-mode)
;; (message "Signing keys...")
;; (epg-sign-keys context keys local)
;; (message "Signing keys...done")))

View file

@ -69,6 +69,27 @@ instead use \\[customize] (see the info node `Easy Customization')."
"Coding system to use with messages from `epg-gpg-program'."
:type 'symbol)
;; In the doc string below, we say "symbol `error'" to avoid producing
;; a hyperlink for `error' the function.
(defcustom epg-pinentry-mode nil
"The pinentry mode.
GnuPG 2.1 or later has an option to control the behavior of
Pinentry invocation. The value should be the symbol `error',
`ask', `cancel', or `loopback'. See the GnuPG manual for the
meanings.
A particularly useful mode is `loopback', which redirects all
Pinentry queries to the caller, so Emacs can query passphrase
through the minibuffer, instead of external Pinentry program."
:type '(choice (const nil)
(const ask)
(const cancel)
(const error)
(const loopback))
:version "27.1")
(defcustom epg-debug nil
"If non-nil, debug output goes to the \" *epg-debug*\" buffer.
Note that the buffer name starts with a space."

View file

@ -207,7 +207,7 @@
output-file
result
operation
pinentry-mode
(pinentry-mode epg-pinentry-mode)
(error-output "")
error-buffer)