(defun epa-progress-callback-function (context what char current total
handback)
- (message "%s: %d%% (%d/%d)" what
+ (message "%s%d%% (%d/%d)" (or handback
+ (concat what ": "))
(if (> total 0) (floor (* (/ current (float total)) 100)) 0)
current total))
(epg-context-set-passphrase-callback context
#'epa-passphrase-callback-function)
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ (format "Decrypting %s..."
+ (file-name-nondirectory file)))
(message "Decrypting %s..." (file-name-nondirectory file))
(epg-decrypt-file context file plain)
(message "Decrypting %s...wrote %s" (file-name-nondirectory file)
(plain (if (equal (file-name-extension file) "sig")
(file-name-sans-extension file))))
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ (format "Verifying %s..."
+ (file-name-nondirectory file)))
(message "Verifying %s..." (file-name-nondirectory file))
(epg-verify-file context file plain)
(message "Verifying %s...done" (file-name-nondirectory file))
(epg-context-set-passphrase-callback context
#'epa-passphrase-callback-function)
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ (format "Signing %s..."
+ (file-name-nondirectory file)))
(message "Signing %s..." (file-name-nondirectory file))
(epg-sign-file context file signature mode)
(message "Signing %s...wrote %s" (file-name-nondirectory file)
(epg-context-set-passphrase-callback context
#'epa-passphrase-callback-function)
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ (format "Encrypting %s..."
+ (file-name-nondirectory file)))
(message "Encrypting %s..." (file-name-nondirectory file))
(epg-encrypt-file context file recipients cipher)
(message "Encrypting %s...wrote %s" (file-name-nondirectory file)
(epg-context-set-passphrase-callback context
#'epa-passphrase-callback-function)
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ "Decrypting...")
(message "Decrypting...")
(setq plain (epg-decrypt-string context (buffer-substring start end)))
(message "Decrypting...done")
(interactive "r")
(let ((context (epg-make-context epa-protocol)))
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ "Verifying...")
(epg-verify-string context
(epa--encode-coding-string
(buffer-substring start end)
(epg-context-set-passphrase-callback context
#'epa-passphrase-callback-function)
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ "Signing...")
(message "Signing...")
(setq signature (epg-sign-string context
(epa--encode-coding-string
(epg-context-set-passphrase-callback context
#'epa-passphrase-callback-function)
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ "Encrypting...")
(message "Encrypting...")
(setq cipher (epg-encrypt-string context
(epa--encode-coding-string
(when (epa--mail-mode-p)
(save-restriction
(narrow-to-region (point)
- (progn
- (search-forward mail-header-separator nil 0)
- (match-beginning 0)))
+ (if (search-forward mail-header-separator nil 0)
+ (match-beginning 0)
+ (point)))
(setq recipients
(mail-strip-quoted-names
(mapconcat #'identity
(epg-context-set-passphrase-callback context
#'epa-passphrase-callback-function)
(epg-context-set-progress-callback context
- #'epa-progress-callback-function)
+ #'epa-progress-callback-function
+ "Signing keys...")
(message "Signing keys...")
(epg-sign-keys context keys local)
(message "Signing keys...done")))