diff options
| author | Noam Postavsky | 2018-04-29 10:32:03 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2018-05-23 07:53:58 -0400 |
| commit | 302e500087fd4cc1c5f37ec87c98e828b22aaa05 (patch) | |
| tree | b9367f87996ecddb79c3e8f2b5a487f66cf2f8cb | |
| parent | 21ab346a07eff8ba43cb2738dc6752f012b77670 (diff) | |
| download | emacs-302e500087fd4cc1c5f37ec87c98e828b22aaa05.tar.gz emacs-302e500087fd4cc1c5f37ec87c98e828b22aaa05.zip | |
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.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/epa-file.el | 2 | ||||
| -rw-r--r-- | lisp/epa.el | 30 | ||||
| -rw-r--r-- | lisp/epg-config.el | 21 | ||||
| -rw-r--r-- | lisp/epg.el | 2 |
5 files changed, 27 insertions, 31 deletions
| @@ -453,6 +453,9 @@ are formatted as MIME digests. | |||
| 453 | *** 'message-forward-included-headers' has changed its default to | 453 | *** 'message-forward-included-headers' has changed its default to |
| 454 | exclude most headers when forwarding. | 454 | exclude most headers when forwarding. |
| 455 | 455 | ||
| 456 | ** 'epa-pinentry-mode' is renamed to 'epg-pinentry-mode'. | ||
| 457 | It now applies to epg functions as well as epa functions. | ||
| 458 | |||
| 456 | * New Modes and Packages in Emacs 27.1 | 459 | * New Modes and Packages in Emacs 27.1 |
| 457 | 460 | ||
| 458 | +++ | 461 | +++ |
diff --git a/lisp/epa-file.el b/lisp/epa-file.el index 1de2f9ba2d8..866a4ae03a7 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el | |||
| @@ -147,7 +147,6 @@ encryption is used." | |||
| 147 | context | 147 | context |
| 148 | (cons #'epa-progress-callback-function | 148 | (cons #'epa-progress-callback-function |
| 149 | (format "Decrypting %s" file))) | 149 | (format "Decrypting %s" file))) |
| 150 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 151 | (unwind-protect | 150 | (unwind-protect |
| 152 | (progn | 151 | (progn |
| 153 | (if replace | 152 | (if replace |
| @@ -236,7 +235,6 @@ encryption is used." | |||
| 236 | (cons #'epa-progress-callback-function | 235 | (cons #'epa-progress-callback-function |
| 237 | (format "Encrypting %s" file))) | 236 | (format "Encrypting %s" file))) |
| 238 | (setf (epg-context-armor context) epa-armor) | 237 | (setf (epg-context-armor context) epa-armor) |
| 239 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 240 | (condition-case error | 238 | (condition-case error |
| 241 | (setq string | 239 | (setq string |
| 242 | (epg-encrypt-string | 240 | (epg-encrypt-string |
diff --git a/lisp/epa.el b/lisp/epa.el index a375cd61707..16621659a6a 100644 --- a/lisp/epa.el +++ b/lisp/epa.el | |||
| @@ -56,27 +56,8 @@ If neither t nor nil, ask user for confirmation." | |||
| 56 | :type 'integer | 56 | :type 'integer |
| 57 | :group 'epa) | 57 | :group 'epa) |
| 58 | 58 | ||
| 59 | ;; In the doc string below, we say "symbol `error'" to avoid producing | 59 | (define-obsolete-variable-alias |
| 60 | ;; a hyperlink for `error' the function. | 60 | 'epa-pinentry-mode 'epg-pinentry-mode "27.1") |
| 61 | (defcustom epa-pinentry-mode nil | ||
| 62 | "The pinentry mode. | ||
| 63 | |||
| 64 | GnuPG 2.1 or later has an option to control the behavior of | ||
| 65 | Pinentry invocation. The value should be the symbol `error', | ||
| 66 | `ask', `cancel', or `loopback'. See the GnuPG manual for the | ||
| 67 | meanings. | ||
| 68 | |||
| 69 | In epa commands, a particularly useful mode is `loopback', which | ||
| 70 | redirects all Pinentry queries to the caller, so Emacs can query | ||
| 71 | passphrase through the minibuffer, instead of external Pinentry | ||
| 72 | program." | ||
| 73 | :type '(choice (const nil) | ||
| 74 | (const ask) | ||
| 75 | (const cancel) | ||
| 76 | (const error) | ||
| 77 | (const loopback)) | ||
| 78 | :group 'epa | ||
| 79 | :version "25.1") | ||
| 80 | 61 | ||
| 81 | (defgroup epa-faces nil | 62 | (defgroup epa-faces nil |
| 82 | "Faces for epa-mode." | 63 | "Faces for epa-mode." |
| @@ -695,7 +676,6 @@ If you do not specify PLAIN-FILE, this functions prompts for the value to use." | |||
| 695 | #'epa-progress-callback-function | 676 | #'epa-progress-callback-function |
| 696 | (format "Decrypting %s..." | 677 | (format "Decrypting %s..." |
| 697 | (file-name-nondirectory decrypt-file)))) | 678 | (file-name-nondirectory decrypt-file)))) |
| 698 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 699 | (message "Decrypting %s..." (file-name-nondirectory decrypt-file)) | 679 | (message "Decrypting %s..." (file-name-nondirectory decrypt-file)) |
| 700 | (condition-case error | 680 | (condition-case error |
| 701 | (epg-decrypt-file context decrypt-file plain-file) | 681 | (epg-decrypt-file context decrypt-file plain-file) |
| @@ -791,7 +771,6 @@ If no one is selected, default secret key is used. " | |||
| 791 | #'epa-progress-callback-function | 771 | #'epa-progress-callback-function |
| 792 | (format "Signing %s..." | 772 | (format "Signing %s..." |
| 793 | (file-name-nondirectory file)))) | 773 | (file-name-nondirectory file)))) |
| 794 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 795 | (message "Signing %s..." (file-name-nondirectory file)) | 774 | (message "Signing %s..." (file-name-nondirectory file)) |
| 796 | (condition-case error | 775 | (condition-case error |
| 797 | (epg-sign-file context file signature mode) | 776 | (epg-sign-file context file signature mode) |
| @@ -822,7 +801,6 @@ If no one is selected, symmetric encryption will be performed. "))) | |||
| 822 | #'epa-progress-callback-function | 801 | #'epa-progress-callback-function |
| 823 | (format "Encrypting %s..." | 802 | (format "Encrypting %s..." |
| 824 | (file-name-nondirectory file)))) | 803 | (file-name-nondirectory file)))) |
| 825 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 826 | (message "Encrypting %s..." (file-name-nondirectory file)) | 804 | (message "Encrypting %s..." (file-name-nondirectory file)) |
| 827 | (condition-case error | 805 | (condition-case error |
| 828 | (epg-encrypt-file context file recipients cipher) | 806 | (epg-encrypt-file context file recipients cipher) |
| @@ -865,7 +843,6 @@ For example: | |||
| 865 | (cons | 843 | (cons |
| 866 | #'epa-progress-callback-function | 844 | #'epa-progress-callback-function |
| 867 | "Decrypting...")) | 845 | "Decrypting...")) |
| 868 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 869 | (message "Decrypting...") | 846 | (message "Decrypting...") |
| 870 | (condition-case error | 847 | (condition-case error |
| 871 | (setq plain (epg-decrypt-string context (buffer-substring start end))) | 848 | (setq plain (epg-decrypt-string context (buffer-substring start end))) |
| @@ -1070,7 +1047,6 @@ If no one is selected, default secret key is used. " | |||
| 1070 | (cons | 1047 | (cons |
| 1071 | #'epa-progress-callback-function | 1048 | #'epa-progress-callback-function |
| 1072 | "Signing...")) | 1049 | "Signing...")) |
| 1073 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 1074 | (message "Signing...") | 1050 | (message "Signing...") |
| 1075 | (condition-case error | 1051 | (condition-case error |
| 1076 | (setq signature (epg-sign-string context | 1052 | (setq signature (epg-sign-string context |
| @@ -1159,7 +1135,6 @@ If no one is selected, symmetric encryption will be performed. ") | |||
| 1159 | (cons | 1135 | (cons |
| 1160 | #'epa-progress-callback-function | 1136 | #'epa-progress-callback-function |
| 1161 | "Encrypting...")) | 1137 | "Encrypting...")) |
| 1162 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 1163 | (message "Encrypting...") | 1138 | (message "Encrypting...") |
| 1164 | (condition-case error | 1139 | (condition-case error |
| 1165 | (setq cipher (epg-encrypt-string context | 1140 | (setq cipher (epg-encrypt-string context |
| @@ -1328,7 +1303,6 @@ If no one is selected, default public key is exported. "))) | |||
| 1328 | ;; (cons | 1303 | ;; (cons |
| 1329 | ;; #'epa-progress-callback-function | 1304 | ;; #'epa-progress-callback-function |
| 1330 | ;; "Signing keys...")) | 1305 | ;; "Signing keys...")) |
| 1331 | ;; (setf (epg-context-pinentry-mode context) epa-pinentry-mode) | ||
| 1332 | ;; (message "Signing keys...") | 1306 | ;; (message "Signing keys...") |
| 1333 | ;; (epg-sign-keys context keys local) | 1307 | ;; (epg-sign-keys context keys local) |
| 1334 | ;; (message "Signing keys...done"))) | 1308 | ;; (message "Signing keys...done"))) |
diff --git a/lisp/epg-config.el b/lisp/epg-config.el index bf9360cdb4f..9d9bd7101e1 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el | |||
| @@ -69,6 +69,27 @@ instead use \\[customize] (see the info node `Easy Customization')." | |||
| 69 | "Coding system to use with messages from `epg-gpg-program'." | 69 | "Coding system to use with messages from `epg-gpg-program'." |
| 70 | :type 'symbol) | 70 | :type 'symbol) |
| 71 | 71 | ||
| 72 | |||
| 73 | ;; In the doc string below, we say "symbol `error'" to avoid producing | ||
| 74 | ;; a hyperlink for `error' the function. | ||
| 75 | (defcustom epg-pinentry-mode nil | ||
| 76 | "The pinentry mode. | ||
| 77 | |||
| 78 | GnuPG 2.1 or later has an option to control the behavior of | ||
| 79 | Pinentry invocation. The value should be the symbol `error', | ||
| 80 | `ask', `cancel', or `loopback'. See the GnuPG manual for the | ||
| 81 | meanings. | ||
| 82 | |||
| 83 | A particularly useful mode is `loopback', which redirects all | ||
| 84 | Pinentry queries to the caller, so Emacs can query passphrase | ||
| 85 | through the minibuffer, instead of external Pinentry program." | ||
| 86 | :type '(choice (const nil) | ||
| 87 | (const ask) | ||
| 88 | (const cancel) | ||
| 89 | (const error) | ||
| 90 | (const loopback)) | ||
| 91 | :version "27.1") | ||
| 92 | |||
| 72 | (defcustom epg-debug nil | 93 | (defcustom epg-debug nil |
| 73 | "If non-nil, debug output goes to the \" *epg-debug*\" buffer. | 94 | "If non-nil, debug output goes to the \" *epg-debug*\" buffer. |
| 74 | Note that the buffer name starts with a space." | 95 | Note that the buffer name starts with a space." |
diff --git a/lisp/epg.el b/lisp/epg.el index e6b4af2b36e..f79f2046ded 100644 --- a/lisp/epg.el +++ b/lisp/epg.el | |||
| @@ -207,7 +207,7 @@ | |||
| 207 | output-file | 207 | output-file |
| 208 | result | 208 | result |
| 209 | operation | 209 | operation |
| 210 | pinentry-mode | 210 | (pinentry-mode epg-pinentry-mode) |
| 211 | (error-output "") | 211 | (error-output "") |
| 212 | error-buffer) | 212 | error-buffer) |
| 213 | 213 | ||