summaryrefslogtreecommitdiff
path: root/lisp/epa.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2020-02-18 16:42:20 +0100
committerJonas Bernoulli <jonas@bernoul.li>2020-08-13 11:30:16 +0200
commitc5b9d2a4b46c6da7d5c88a8c51be5294b2d5edc9 (patch)
treebbf9766ac030de9573e49a3f2862d9e4386ca03a /lisp/epa.el
parent562bbd0a367b8d4239215c70f8548fed5ab47bac (diff)
downloademacs-c5b9d2a4b46c6da7d5c88a8c51be5294b2d5edc9.tar.gz
emacs-c5b9d2a4b46c6da7d5c88a8c51be5294b2d5edc9.tar.bz2
emacs-c5b9d2a4b46c6da7d5c88a8c51be5294b2d5edc9.zip
Split EasyPG libraries into outline sections
* lisp/epa-dired.el: lisp/epa-file.el: lisp/epa-hook.el: lisp/epa-mail.el: lisp/epa.el: lisp/epg-config.el: lisp/epg.el: Split into outline sections. * lisp/epg.el (epg-error): Move definition.
Diffstat (limited to 'lisp/epa.el')
-rw-r--r--lisp/epa.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/epa.el b/lisp/epa.el
index a2c5fb46737..d190824293f 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -21,6 +21,7 @@
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
+;;; Dependencies
(require 'epg)
(require 'font-lock)
@@ -30,6 +31,8 @@
(require 'wid-edit))
(require 'derived)
+;;; Options
+
(defgroup epa nil
"The EasyPG Assistant"
:version "23.1"
@@ -73,6 +76,8 @@ The command `epa-mail-encrypt' uses this."
:group 'epa
:version "24.4")
+;;; Faces
+
(defgroup epa-faces nil
"Faces for epa-mode."
:version "23.1"
@@ -146,6 +151,8 @@ The command `epa-mail-encrypt' uses this."
:type '(repeat (cons symbol face))
:group 'epa-faces)
+;;; Variables
+
(defvar epa-font-lock-keywords
'(("^\\*"
(0 'epa-mark))
@@ -252,6 +259,8 @@ You should bind this variable with `let', but do not set it globally.")
(defvar epa-exit-buffer-function #'quit-window)
+;;; Key Widget
+
(define-widget 'epa-key 'push-button
"Button for representing an epg-key object."
:format "%[%v%]"
@@ -293,6 +302,8 @@ You should bind this variable with `let', but do not set it globally.")
(epg-sub-key-id (car (epg-key-sub-key-list
(widget-get widget :value))))))
+;;; Modes
+
(define-derived-mode epa-key-list-mode special-mode "EPA Keys"
"Major mode for `epa-list-keys'."
(buffer-disable-undo)
@@ -316,6 +327,9 @@ You should bind this variable with `let', but do not set it globally.")
(setq truncate-lines t
buffer-read-only t))
+;;; Commands
+;;;; Marking
+
(defun epa-mark-key (&optional arg)
"Mark a key on the current line.
If ARG is non-nil, unmark the key."
@@ -338,11 +352,15 @@ If ARG is non-nil, mark the key."
(interactive "P")
(epa-mark-key (not arg)))
+;;;; Quitting
+
(defun epa-exit-buffer ()
"Exit the current buffer using `epa-exit-buffer-function'."
(interactive)
(funcall epa-exit-buffer-function))
+;;;; Listing and Selecting
+
(defun epa--insert-keys (keys)
(save-excursion
(save-restriction
@@ -505,6 +523,8 @@ If SECRET is non-nil, list secret keys instead of public keys."
(let ((keys (epg-list-keys context names secret)))
(epa--select-keys prompt keys)))
+;;;; Key Details
+
(defun epa-show-key ()
"Show a key on the current line."
(interactive)
@@ -591,6 +611,8 @@ If SECRET is non-nil, list secret keys instead of public keys."
(goto-char (point-min))
(pop-to-buffer (current-buffer))))
+;;;; Encryption and Signatures
+
(defun epa-display-info (info)
(if epa-popup-info-window
(save-selected-window
@@ -1182,6 +1204,8 @@ If no one is selected, symmetric encryption will be performed. ")
'start-open t
'end-open t)))))
+;;;; Key Management
+
;;;###autoload
(defun epa-delete-keys (keys &optional allow-secret)
"Delete selected KEYS."