* epa.el (epa-mark-key): Renamed from epa-mark.
[elisp/epg.git] / epa.el
diff --git a/epa.el b/epa.el
index 51b6d53..bc2938a 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -177,8 +177,8 @@ You should bind this variable with `let', but do not set it globally.")
 
 (defvar epa-key-list-mode-map
   (let ((keymap (make-sparse-keymap)))
-    (define-key keymap "m" 'epa-mark)
-    (define-key keymap "u" 'epa-unmark)
+    (define-key keymap "m" 'epa-mark-key)
+    (define-key keymap "u" 'epa-unmark-key)
     (define-key keymap "d" 'epa-decrypt-file)
     (define-key keymap "v" 'epa-verify-file)
     (define-key keymap "s" 'epa-sign-file)
@@ -301,30 +301,27 @@ You should bind this variable with `let', but do not set it globally.")
   (use-local-map epa-info-mode-map)
   (run-hooks 'epa-info-mode-hook))
 
-(defun epa-mark (&optional arg)
-  "Mark the current line.
-If ARG is non-nil, unmark the current line."
+(defun epa-mark-key (&optional arg)
+  "Mark a key on the current line.
+If ARG is non-nil, unmark the key."
   (interactive "P")
   (let ((inhibit-read-only t)
        buffer-read-only
        properties)
     (beginning-of-line)
+    (unless (get-text-property (point) 'epa-key)
+      (error "No key on this line"))
     (setq properties (text-properties-at (point)))
     (delete-char 1)
     (insert (if arg " " "*"))
     (set-text-properties (1- (point)) (point) properties)
     (forward-line)))
 
-(defun epa-unmark (&optional arg)
-  "Unmark the current line.
-If ARG is non-nil, mark the current line."
+(defun epa-unmark-key (&optional arg)
+  "Unmark a key on the current line.
+If ARG is non-nil, mark the key."
   (interactive "P")
-  (epa-mark (not arg)))
-
-(defun epa-toggle-mark ()
-  "Toggle the mark the current line."
-  (interactive)
-  (epa-mark (eq (char-after (save-excursion (beginning-of-line) (point))) ?*)))
+  (epa-mark-key (not arg)))
 
 (defun epa-exit-buffer ()
   "Exit the current buffer.
@@ -436,8 +433,8 @@ If ARG is non-nil, mark the current line."
       (erase-buffer)
       (insert prompt "\n"
              (substitute-command-keys "\
-- `\\[epa-mark]' to mark a key on the line
-- `\\[epa-unmark]' to unmark a key on the line\n"))
+- `\\[epa-mark-key]' to mark a key on the line
+- `\\[epa-unmark-key]' to unmark a key on the line\n"))
       (widget-create 'link
                     :notify (lambda (&rest ignore) (abort-recursive-edit))
                     :help-echo