2007-04-19 Daiki Ueno <ueno@unixuser.org>
+ * epa.el (epa-mark-key): Renamed from epa-mark.
+ (epa-unmark-key): Renamed from epa-unmark.
+ (epa-toggle-mark): Abolished.
+
* epa-file.el (epa-file-insert-file-contents): Guess the value of
epa-file-encrypt-to from 'encrypted-to context-result.
(epa-file-encrypt-to): Make it permanent local.
(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)
(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.
(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