summaryrefslogtreecommitdiff
path: root/lisp/epa.el
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2014-11-18 14:49:30 +0900
committerDaiki Ueno <ueno@gnu.org>2014-11-18 14:53:54 +0900
commit5224be2f7401bd9999b5442a94d0b2abf7f4da3b (patch)
tree413f1682a2061840c1c897629a6686827ba21e67 /lisp/epa.el
parentb12bb4dc3ecc74c99031538fc8d3565d276a18d7 (diff)
downloademacs-5224be2f7401bd9999b5442a94d0b2abf7f4da3b.tar.gz
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.
Diffstat (limited to 'lisp/epa.el')
-rw-r--r--lisp/epa.el18
1 files changed, 6 insertions, 12 deletions
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. "
#'epa-progress-callback-function
(format "Signing %s..."
(file-name-nondirectory file))))
- (if epa-pinentry-mode
- (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+ (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)
@@ -815,8 +814,7 @@ If no one is selected, symmetric encryption will be performed. ")))
#'epa-progress-callback-function
(format "Encrypting %s..."
(file-name-nondirectory file))))
- (if epa-pinentry-mode
- (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+ (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)
@@ -859,8 +857,7 @@ For example:
(cons
#'epa-progress-callback-function
"Decrypting..."))
- (if epa-pinentry-mode
- (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+ (setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Decrypting...")
(condition-case error
(setq plain (epg-decrypt-string context (buffer-substring start end)))
@@ -1067,8 +1064,7 @@ If no one is selected, default secret key is used. "
(cons
#'epa-progress-callback-function
"Signing..."))
- (if epa-pinentry-mode
- (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+ (setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Signing...")
(condition-case error
(setq signature (epg-sign-string context
@@ -1157,8 +1153,7 @@ If no one is selected, symmetric encryption will be performed. ")
(cons
#'epa-progress-callback-function
"Encrypting..."))
- (if epa-pinentry-mode
- (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+ (setf (epg-context-pinentry-mode context) epa-pinentry-mode)
(message "Encrypting...")
(condition-case error
(setq cipher (epg-encrypt-string context
@@ -1327,8 +1322,7 @@ If no one is selected, default public key is exported. ")))
;; (cons
;; #'epa-progress-callback-function
;; "Signing keys..."))
-;; (if epa-pinentry-mode
-;; (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+;; (setf (epg-context-pinentry-mode context) epa-pinentry-mode)
;; (message "Signing keys...")
;; (epg-sign-keys context keys local)
;; (message "Signing keys...done")))