1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Use lexical binding in ep[ga]*.el.

* epa-dired.el:
* epa-mail.el:
* epa-hook.el:
* epa-file.el:
* epa.el:
* epg.el: Use lexical binding.
This commit is contained in:
Daiki Ueno 2011-04-04 15:16:23 +09:00
parent f84c17c70c
commit 74f5069555
7 changed files with 41 additions and 32 deletions

View file

@ -1,3 +1,12 @@
2011-04-04 Daiki Ueno <ueno@unixuser.org>
* epa-dired.el:
* epa-mail.el:
* epa-hook.el:
* epa-file.el:
* epa.el:
* epg.el: Use lexical binding.
2011-04-03 Chong Yidong <cyd@stupidchicken.com> 2011-04-03 Chong Yidong <cyd@stupidchicken.com>
* dired-aux.el (dired-create-files): Add docstring (Bug#7970). * dired-aux.el (dired-create-files): Add docstring (Bug#7970).

View file

@ -1,4 +1,4 @@
;;; epa-dired.el --- the EasyPG Assistant, dired extension ;;; epa-dired.el --- the EasyPG Assistant, dired extension -*- lexical-binding: t -*-
;; Copyright (C) 2006-2011 Free Software Foundation, Inc. ;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org> ;; Author: Daiki Ueno <ueno@unixuser.org>

View file

@ -1,4 +1,4 @@
;;; epa-file.el --- the EasyPG Assistant, transparent file encryption ;;; epa-file.el --- the EasyPG Assistant, transparent file encryption -*- lexical-binding: t -*-
;; Copyright (C) 2006-2011 Free Software Foundation, Inc. ;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org> ;; Author: Daiki Ueno <ueno@unixuser.org>

View file

@ -1,4 +1,4 @@
;;; epa-hook.el --- preloaded code to enable epa-file.el ;;; epa-hook.el --- preloaded code to enable epa-file.el -*- lexical-binding: t -*-
;; Copyright (C) 2006-2011 Free Software Foundation, Inc. ;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org> ;; Author: Daiki Ueno <ueno@unixuser.org>

View file

@ -1,4 +1,4 @@
;;; epa-mail.el --- the EasyPG Assistant, minor-mode for mail composer ;;; epa-mail.el --- the EasyPG Assistant, minor-mode for mail composer -*- lexical-binding: t -*-
;; Copyright (C) 2006-2011 Free Software Foundation, Inc. ;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org> ;; Author: Daiki Ueno <ueno@unixuser.org>
@ -117,7 +117,7 @@ Don't use this command in Lisp programs!"
(save-excursion (save-excursion
(let ((verbose current-prefix-arg) (let ((verbose current-prefix-arg)
(context (epg-make-context epa-protocol)) (context (epg-make-context epa-protocol))
recipients-string recipients recipient-key) recipients-string recipients recipient-key sign)
(goto-char (point-min)) (goto-char (point-min))
(save-restriction (save-restriction
(narrow-to-region (point) (narrow-to-region (point)

View file

@ -1,4 +1,4 @@
;;; epa.el --- the EasyPG Assistant ;;; epa.el --- the EasyPG Assistant -*- lexical-binding: t -*-
;; Copyright (C) 2006-2011 Free Software Foundation, Inc. ;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
@ -269,7 +269,7 @@ You should bind this variable with `let', but do not set it globally.")
:action 'epa--key-widget-action :action 'epa--key-widget-action
:help-echo 'epa--key-widget-help-echo) :help-echo 'epa--key-widget-help-echo)
(defun epa--key-widget-action (widget &optional event) (defun epa--key-widget-action (widget &optional _event)
(save-selected-window (save-selected-window
(epa--show-key (widget-get widget :value)))) (epa--show-key (widget-get widget :value))))
@ -460,7 +460,7 @@ If ARG is non-nil, mark the key."
(list nil))) (list nil)))
(epa--list-keys name t)) (epa--list-keys name t))
(defun epa--key-list-revert-buffer (&optional ignore-auto noconfirm) (defun epa--key-list-revert-buffer (&optional _ignore-auto _noconfirm)
(apply #'epa--list-keys epa-list-keys-arguments)) (apply #'epa--list-keys epa-list-keys-arguments))
(defun epa--marked-keys () (defun epa--marked-keys ()
@ -490,13 +490,13 @@ If ARG is non-nil, mark the key."
- `\\[epa-mark-key]' to mark a key on the line - `\\[epa-mark-key]' to mark a key on the line
- `\\[epa-unmark-key]' to unmark a key on the line\n")) - `\\[epa-unmark-key]' to unmark a key on the line\n"))
(widget-create 'link (widget-create 'link
:notify (lambda (&rest ignore) (abort-recursive-edit)) :notify (lambda (&rest _ignore) (abort-recursive-edit))
:help-echo :help-echo
(substitute-command-keys (substitute-command-keys
"Click here or \\[abort-recursive-edit] to cancel") "Click here or \\[abort-recursive-edit] to cancel")
"Cancel") "Cancel")
(widget-create 'link (widget-create 'link
:notify (lambda (&rest ignore) (exit-recursive-edit)) :notify (lambda (&rest _ignore) (exit-recursive-edit))
:help-echo :help-echo
(substitute-command-keys (substitute-command-keys
"Click here or \\[exit-recursive-edit] to finish") "Click here or \\[exit-recursive-edit] to finish")
@ -649,7 +649,7 @@ If SECRET is non-nil, list secret keys instead of public keys."
(format "Passphrase for %s %s: " key-id (cdr entry)) (format "Passphrase for %s %s: " key-id (cdr entry))
(format "Passphrase for %s: " key-id))))))) (format "Passphrase for %s: " key-id)))))))
(defun epa-progress-callback-function (context what char current total (defun epa-progress-callback-function (_context what _char current total
handback) handback)
(message "%s%d%% (%d/%d)" (or handback (message "%s%d%% (%d/%d)" (or handback
(concat what ": ")) (concat what ": "))
@ -964,7 +964,7 @@ See the reason described in the `epa-verify-region' documentation."
(eval-and-compile (eval-and-compile
(if (fboundp 'select-safe-coding-system) (if (fboundp 'select-safe-coding-system)
(defalias 'epa--select-safe-coding-system 'select-safe-coding-system) (defalias 'epa--select-safe-coding-system 'select-safe-coding-system)
(defun epa--select-safe-coding-system (from to) (defun epa--select-safe-coding-system (_from _to)
buffer-file-coding-system))) buffer-file-coding-system)))
;;;###autoload ;;;###autoload

View file

@ -1,4 +1,4 @@
;;; epg.el --- the EasyPG Library ;;; epg.el --- the EasyPG Library -*- lexical-binding: t -*-
;; Copyright (C) 1999-2000, 2002-2011 Free Software Foundation, Inc. ;; Copyright (C) 1999-2000, 2002-2011 Free Software Foundation, Inc.
;; Author: Daiki Ueno <ueno@unixuser.org> ;; Author: Daiki Ueno <ueno@unixuser.org>
@ -1223,7 +1223,7 @@ This function is for internal use only."
(defalias 'epg--decode-coding-string 'decode-coding-string) (defalias 'epg--decode-coding-string 'decode-coding-string)
(defalias 'epg--decode-coding-string 'identity))) (defalias 'epg--decode-coding-string 'identity)))
(defun epg--status-USERID_HINT (context string) (defun epg--status-USERID_HINT (_context string)
(if (string-match "\\`\\([^ ]+\\) \\(.*\\)" string) (if (string-match "\\`\\([^ ]+\\) \\(.*\\)" string)
(let* ((key-id (match-string 1 string)) (let* ((key-id (match-string 1 string))
(user-id (match-string 2 string)) (user-id (match-string 2 string))
@ -1238,14 +1238,14 @@ This function is for internal use only."
(setq epg-user-id-alist (cons (cons key-id user-id) (setq epg-user-id-alist (cons (cons key-id user-id)
epg-user-id-alist)))))) epg-user-id-alist))))))
(defun epg--status-NEED_PASSPHRASE (context string) (defun epg--status-NEED_PASSPHRASE (_context string)
(if (string-match "\\`\\([^ ]+\\)" string) (if (string-match "\\`\\([^ ]+\\)" string)
(setq epg-key-id (match-string 1 string)))) (setq epg-key-id (match-string 1 string))))
(defun epg--status-NEED_PASSPHRASE_SYM (context string) (defun epg--status-NEED_PASSPHRASE_SYM (_context _string)
(setq epg-key-id 'SYM)) (setq epg-key-id 'SYM))
(defun epg--status-NEED_PASSPHRASE_PIN (context string) (defun epg--status-NEED_PASSPHRASE_PIN (_context _string)
(setq epg-key-id 'PIN)) (setq epg-key-id 'PIN))
(eval-and-compile (eval-and-compile
@ -1308,11 +1308,11 @@ This function is for internal use only."
(if encoded-passphrase-with-new-line (if encoded-passphrase-with-new-line
(epg--clear-string encoded-passphrase-with-new-line)))))) (epg--clear-string encoded-passphrase-with-new-line))))))
(defun epg--prompt-GET_BOOL (context string) (defun epg--prompt-GET_BOOL (_context string)
(let ((entry (assoc string epg-prompt-alist))) (let ((entry (assoc string epg-prompt-alist)))
(y-or-n-p (if entry (cdr entry) (concat string "? "))))) (y-or-n-p (if entry (cdr entry) (concat string "? ")))))
(defun epg--prompt-GET_BOOL-untrusted_key.override (context string) (defun epg--prompt-GET_BOOL-untrusted_key.override (_context _string)
(y-or-n-p (if (and (equal (car epg-last-status) "USERID_HINT") (y-or-n-p (if (and (equal (car epg-last-status) "USERID_HINT")
(string-match "\\`\\([^ ]+\\) \\(.*\\)" (string-match "\\`\\([^ ]+\\) \\(.*\\)"
(cdr epg-last-status))) (cdr epg-last-status)))
@ -1467,31 +1467,31 @@ This function is for internal use only."
signature signature
(string-to-number (match-string 7 string) 16))))) (string-to-number (match-string 7 string) 16)))))
(defun epg--status-TRUST_UNDEFINED (context string) (defun epg--status-TRUST_UNDEFINED (context _string)
(let ((signature (car (epg-context-result-for context 'verify)))) (let ((signature (car (epg-context-result-for context 'verify))))
(if (and signature (if (and signature
(eq (epg-signature-status signature) 'good)) (eq (epg-signature-status signature) 'good))
(epg-signature-set-validity signature 'undefined)))) (epg-signature-set-validity signature 'undefined))))
(defun epg--status-TRUST_NEVER (context string) (defun epg--status-TRUST_NEVER (context _string)
(let ((signature (car (epg-context-result-for context 'verify)))) (let ((signature (car (epg-context-result-for context 'verify))))
(if (and signature (if (and signature
(eq (epg-signature-status signature) 'good)) (eq (epg-signature-status signature) 'good))
(epg-signature-set-validity signature 'never)))) (epg-signature-set-validity signature 'never))))
(defun epg--status-TRUST_MARGINAL (context string) (defun epg--status-TRUST_MARGINAL (context _string)
(let ((signature (car (epg-context-result-for context 'verify)))) (let ((signature (car (epg-context-result-for context 'verify))))
(if (and signature (if (and signature
(eq (epg-signature-status signature) 'marginal)) (eq (epg-signature-status signature) 'marginal))
(epg-signature-set-validity signature 'marginal)))) (epg-signature-set-validity signature 'marginal))))
(defun epg--status-TRUST_FULLY (context string) (defun epg--status-TRUST_FULLY (context _string)
(let ((signature (car (epg-context-result-for context 'verify)))) (let ((signature (car (epg-context-result-for context 'verify))))
(if (and signature (if (and signature
(eq (epg-signature-status signature) 'good)) (eq (epg-signature-status signature) 'good))
(epg-signature-set-validity signature 'full)))) (epg-signature-set-validity signature 'full))))
(defun epg--status-TRUST_ULTIMATE (context string) (defun epg--status-TRUST_ULTIMATE (context _string)
(let ((signature (car (epg-context-result-for context 'verify)))) (let ((signature (car (epg-context-result-for context 'verify))))
(if (and signature (if (and signature
(eq (epg-signature-status signature) 'good)) (eq (epg-signature-status signature) 'good))
@ -1541,10 +1541,10 @@ This function is for internal use only."
(string-to-number (match-string 3 string))) (string-to-number (match-string 3 string)))
(epg-context-result-for context 'encrypted-to))))) (epg-context-result-for context 'encrypted-to)))))
(defun epg--status-DECRYPTION_FAILED (context string) (defun epg--status-DECRYPTION_FAILED (context _string)
(epg-context-set-result-for context 'decryption-failed t)) (epg-context-set-result-for context 'decryption-failed t))
(defun epg--status-DECRYPTION_OKAY (context string) (defun epg--status-DECRYPTION_OKAY (context _string)
(epg-context-set-result-for context 'decryption-okay t)) (epg-context-set-result-for context 'decryption-okay t))
(defun epg--status-NODATA (context string) (defun epg--status-NODATA (context string)
@ -1566,13 +1566,13 @@ This function is for internal use only."
(epg--time-from-seconds string))) (epg--time-from-seconds string)))
(epg-context-result-for context 'error)))) (epg-context-result-for context 'error))))
(defun epg--status-KEYREVOKED (context string) (defun epg--status-KEYREVOKED (context _string)
(epg-context-set-result-for (epg-context-set-result-for
context 'key context 'key
(cons '(key-revoked) (cons '(key-revoked)
(epg-context-result-for context 'error)))) (epg-context-result-for context 'error))))
(defun epg--status-BADARMOR (context string) (defun epg--status-BADARMOR (context _string)
(epg-context-set-result-for (epg-context-set-result-for
context 'error context 'error
(cons '(bad-armor) (cons '(bad-armor)
@ -1589,7 +1589,7 @@ This function is for internal use only."
(match-string 2 string))) (match-string 2 string)))
(epg-context-result-for context 'error))))) (epg-context-result-for context 'error)))))
(defun epg--status-NO_RECP (context string) (defun epg--status-NO_RECP (context _string)
(epg-context-set-result-for (epg-context-set-result-for
context 'error context 'error
(cons '(no-recipients) (cons '(no-recipients)
@ -1626,13 +1626,13 @@ This function is for internal use only."
(cons 'fingerprint (match-string 2 string))) (cons 'fingerprint (match-string 2 string)))
(epg-context-result-for context 'generate-key))))) (epg-context-result-for context 'generate-key)))))
(defun epg--status-KEY_NOT_CREATED (context string) (defun epg--status-KEY_NOT_CREATED (context _string)
(epg-context-set-result-for (epg-context-set-result-for
context 'error context 'error
(cons '(key-not-created) (cons '(key-not-created)
(epg-context-result-for context 'error)))) (epg-context-result-for context 'error))))
(defun epg--status-IMPORTED (context string) (defun epg--status-IMPORTED (_context string)
(if (string-match "\\`\\([^ ]+\\) \\(.*\\)" string) (if (string-match "\\`\\([^ ]+\\) \\(.*\\)" string)
(let* ((key-id (match-string 1 string)) (let* ((key-id (match-string 1 string))
(user-id (match-string 2 string)) (user-id (match-string 2 string))
@ -1694,7 +1694,7 @@ This function is for internal use only."
(epg-context-result-for context 'import-status))) (epg-context-result-for context 'import-status)))
(epg-context-set-result-for context 'import-status nil))) (epg-context-set-result-for context 'import-status nil)))
(defun epg-passphrase-callback-function (context key-id handback) (defun epg-passphrase-callback-function (context key-id _handback)
(if (eq key-id 'SYM) (if (eq key-id 'SYM)
(read-passwd "Passphrase for symmetric encryption: " (read-passwd "Passphrase for symmetric encryption: "
(eq (epg-context-operation context) 'encrypt)) (eq (epg-context-operation context) 'encrypt))