]> code.delx.au - gnu-emacs/commitdiff
epg: Simplify epa-pinentry-mode handling
authorDaiki Ueno <ueno@gnu.org>
Tue, 18 Nov 2014 05:49:30 +0000 (14:49 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 18 Nov 2014 05:53:54 +0000 (14:53 +0900)
* 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.

lisp/ChangeLog
lisp/epa-file.el
lisp/epa.el

index 462d0047087c0cc931fce174691a78424deea85f..928c89cc8483d164ba2d33d48fff8b0d14c11107 100644 (file)
@@ -1,3 +1,12 @@
+2014-11-18  Daiki Ueno  <ueno@gnu.org>
+
+       * 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.
+
 2014-11-18  Daiki Ueno  <ueno@gnu.org>
 
        * epa-file.el (epa-file-insert-file-contents): Don't show
index cdaa8ba5f3d457a1feba0e901403a5f3e58f41aa..2e46cf9da24d1131d72efc5d72383084f5b110a2 100644 (file)
@@ -144,8 +144,7 @@ encryption is used."
      context
      (cons #'epa-progress-callback-function
           (format "Decrypting %s" file)))
-    (if epa-pinentry-mode
-       (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+    (setf (epg-context-pinentry-mode context) epa-pinentry-mode)
     (unwind-protect
        (progn
          (if replace
@@ -233,8 +232,7 @@ encryption is used."
      (cons #'epa-progress-callback-function
           (format "Encrypting %s" file)))
     (setf (epg-context-armor context) epa-armor)
-    (if epa-pinentry-mode
-       (setf (epg-context-pinentry-mode context) epa-pinentry-mode))
+    (setf (epg-context-pinentry-mode context) epa-pinentry-mode)
     (condition-case error
        (setq string
              (epg-encrypt-string
index 2814716e7a8a533b02dfa7fd2ab309bc6ff87ca1..8b952611243e9279f884e9cd20cb801b4df967b5 100644 (file)
@@ -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")))