diff options
| author | Daiki Ueno | 2014-11-18 14:49:30 +0900 |
|---|---|---|
| committer | Daiki Ueno | 2014-11-18 14:53:54 +0900 |
| commit | 5224be2f7401bd9999b5442a94d0b2abf7f4da3b (patch) | |
| tree | 413f1682a2061840c1c897629a6686827ba21e67 | |
| parent | b12bb4dc3ecc74c99031538fc8d3565d276a18d7 (diff) | |
| download | emacs-5224be2f7401bd9999b5442a94d0b2abf7f4da3b.tar.gz emacs-5224be2f7401bd9999b5442a94d0b2abf7f4da3b.zip | |
epg: Simplify epa-pinentry-mode handling
* epa-file.el (epa-file-insert-file-contents)
(epa-file-write-region): Remove redundant check of
epa-pinentry-mode.
* epa.el (epa-sign-file, epa-encrypt-file, epa-decrypt-region)
(epa-sign-region, epa-encrypt-region): Remove redundant check of
epa-pinentry-mode.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/epa-file.el | 6 | ||||
| -rw-r--r-- | lisp/epa.el | 18 |
3 files changed, 17 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 462d0047087..928c89cc848 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | 2014-11-18 Daiki Ueno <ueno@gnu.org> | 1 | 2014-11-18 Daiki Ueno <ueno@gnu.org> |
| 2 | 2 | ||
| 3 | * epa-file.el (epa-file-insert-file-contents) | ||
| 4 | (epa-file-write-region): Remove redundant check of | ||
| 5 | epa-pinentry-mode. | ||
| 6 | * epa.el (epa-sign-file, epa-encrypt-file, epa-decrypt-region) | ||
| 7 | (epa-sign-region, epa-encrypt-region): Remove redundant check of | ||
| 8 | epa-pinentry-mode. | ||
| 9 | |||
| 10 | 2014-11-18 Daiki Ueno <ueno@gnu.org> | ||
| 11 | |||
| 3 | * epa-file.el (epa-file-insert-file-contents): Don't show | 12 | * epa-file.el (epa-file-insert-file-contents): Don't show |
| 4 | "*Error*" buffer if input file does not exist. | 13 | "*Error*" buffer if input file does not exist. |
| 5 | Reported by Herbert J. Skuhra. | 14 | Reported by Herbert J. Skuhra. |
diff --git a/lisp/epa-file.el b/lisp/epa-file.el index cdaa8ba5f3d..2e46cf9da24 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el | |||
| @@ -144,8 +144,7 @@ encryption is used." | |||
| 144 | context | 144 | context |
| 145 | (cons #'epa-progress-callback-function | 145 | (cons #'epa-progress-callback-function |
| 146 | (format "Decrypting %s" file))) | 146 | (format "Decrypting %s" file))) |
| 147 | (if epa-pinentry-mode | 147 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 148 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 149 | (unwind-protect | 148 | (unwind-protect |
| 150 | (progn | 149 | (progn |
| 151 | (if replace | 150 | (if replace |
| @@ -233,8 +232,7 @@ encryption is used." | |||
| 233 | (cons #'epa-progress-callback-function | 232 | (cons #'epa-progress-callback-function |
| 234 | (format "Encrypting %s" file))) | 233 | (format "Encrypting %s" file))) |
| 235 | (setf (epg-context-armor context) epa-armor) | 234 | (setf (epg-context-armor context) epa-armor) |
| 236 | (if epa-pinentry-mode | 235 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 237 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 238 | (condition-case error | 236 | (condition-case error |
| 239 | (setq string | 237 | (setq string |
| 240 | (epg-encrypt-string | 238 | (epg-encrypt-string |
diff --git a/lisp/epa.el b/lisp/epa.el index 2814716e7a8..8b952611243 100644 --- a/lisp/epa.el +++ b/lisp/epa.el | |||
| @@ -783,8 +783,7 @@ If no one is selected, default secret key is used. " | |||
| 783 | #'epa-progress-callback-function | 783 | #'epa-progress-callback-function |
| 784 | (format "Signing %s..." | 784 | (format "Signing %s..." |
| 785 | (file-name-nondirectory file)))) | 785 | (file-name-nondirectory file)))) |
| 786 | (if epa-pinentry-mode | 786 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 787 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 788 | (message "Signing %s..." (file-name-nondirectory file)) | 787 | (message "Signing %s..." (file-name-nondirectory file)) |
| 789 | (condition-case error | 788 | (condition-case error |
| 790 | (epg-sign-file context file signature mode) | 789 | (epg-sign-file context file signature mode) |
| @@ -815,8 +814,7 @@ If no one is selected, symmetric encryption will be performed. "))) | |||
| 815 | #'epa-progress-callback-function | 814 | #'epa-progress-callback-function |
| 816 | (format "Encrypting %s..." | 815 | (format "Encrypting %s..." |
| 817 | (file-name-nondirectory file)))) | 816 | (file-name-nondirectory file)))) |
| 818 | (if epa-pinentry-mode | 817 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 819 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 820 | (message "Encrypting %s..." (file-name-nondirectory file)) | 818 | (message "Encrypting %s..." (file-name-nondirectory file)) |
| 821 | (condition-case error | 819 | (condition-case error |
| 822 | (epg-encrypt-file context file recipients cipher) | 820 | (epg-encrypt-file context file recipients cipher) |
| @@ -859,8 +857,7 @@ For example: | |||
| 859 | (cons | 857 | (cons |
| 860 | #'epa-progress-callback-function | 858 | #'epa-progress-callback-function |
| 861 | "Decrypting...")) | 859 | "Decrypting...")) |
| 862 | (if epa-pinentry-mode | 860 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 863 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 864 | (message "Decrypting...") | 861 | (message "Decrypting...") |
| 865 | (condition-case error | 862 | (condition-case error |
| 866 | (setq plain (epg-decrypt-string context (buffer-substring start end))) | 863 | (setq plain (epg-decrypt-string context (buffer-substring start end))) |
| @@ -1067,8 +1064,7 @@ If no one is selected, default secret key is used. " | |||
| 1067 | (cons | 1064 | (cons |
| 1068 | #'epa-progress-callback-function | 1065 | #'epa-progress-callback-function |
| 1069 | "Signing...")) | 1066 | "Signing...")) |
| 1070 | (if epa-pinentry-mode | 1067 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 1071 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 1072 | (message "Signing...") | 1068 | (message "Signing...") |
| 1073 | (condition-case error | 1069 | (condition-case error |
| 1074 | (setq signature (epg-sign-string context | 1070 | (setq signature (epg-sign-string context |
| @@ -1157,8 +1153,7 @@ If no one is selected, symmetric encryption will be performed. ") | |||
| 1157 | (cons | 1153 | (cons |
| 1158 | #'epa-progress-callback-function | 1154 | #'epa-progress-callback-function |
| 1159 | "Encrypting...")) | 1155 | "Encrypting...")) |
| 1160 | (if epa-pinentry-mode | 1156 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 1161 | (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 1162 | (message "Encrypting...") | 1157 | (message "Encrypting...") |
| 1163 | (condition-case error | 1158 | (condition-case error |
| 1164 | (setq cipher (epg-encrypt-string context | 1159 | (setq cipher (epg-encrypt-string context |
| @@ -1327,8 +1322,7 @@ If no one is selected, default public key is exported. "))) | |||
| 1327 | ;; (cons | 1322 | ;; (cons |
| 1328 | ;; #'epa-progress-callback-function | 1323 | ;; #'epa-progress-callback-function |
| 1329 | ;; "Signing keys...")) | 1324 | ;; "Signing keys...")) |
| 1330 | ;; (if epa-pinentry-mode | 1325 | ;; (setf (epg-context-pinentry-mode context) epa-pinentry-mode) |
| 1331 | ;; (setf (epg-context-pinentry-mode context) epa-pinentry-mode)) | ||
| 1332 | ;; (message "Signing keys...") | 1326 | ;; (message "Signing keys...") |
| 1333 | ;; (epg-sign-keys context keys local) | 1327 | ;; (epg-sign-keys context keys local) |
| 1334 | ;; (message "Signing keys...done"))) | 1328 | ;; (message "Signing keys...done"))) |