From: ueno Date: Sun, 16 Apr 2006 21:31:15 +0000 (+0000) Subject: Simplified. X-Git-Tag: epgsm-branchpoint~74 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba6865a9315aeabf7ba02dd760cbfc645c8521e6;p=elisp%2Fepg.git Simplified. --- diff --git a/epa.el b/epa.el index fa1f6bf..46e12d0 100644 --- a/epa.el +++ b/epa.el @@ -203,7 +203,7 @@ (let ((inhibit-read-only t) buffer-read-only keys point primary-sub-key primary-user-id) - (setq keys (epg-list-keys)) + (setq keys (epg-list-keys name)) (while keys (setq point (point) primary-sub-key (car (epg-key-sub-key-list (car keys))) @@ -225,7 +225,8 @@ (buffer-live-p epa-keys-buffer)) (setq epa-keys-buffer (generate-new-buffer "*Keys*"))) (let ((inhibit-read-only t) - buffer-read-only) + buffer-read-only + point) (set-buffer epa-keys-buffer) (erase-buffer) (insert prompt "\n\n" @@ -233,7 +234,11 @@ "\n\n") (if names (while names + (setq point (point)) (epa-list-keys-1 (car names)) + (goto-char point) + (epa-mark) + (goto-char (point-max)) (setq names (cdr names))) (epa-list-keys-1 nil)) (epa-keys-mode) @@ -251,7 +256,8 @@ (setq keys (cons key keys)))) (nreverse keys)))) (if (get-buffer-window epa-keys-buffer) - (delete-window (get-buffer-window epa-keys-buffer)))))) + (delete-window (get-buffer-window epa-keys-buffer))) + (kill-buffer epa-keys-buffer)))) (defun epa-show-key (key) (let* ((primary-sub-key (car (epg-key-sub-key-list key))) @@ -316,31 +322,23 @@ (defun epa-show-key-notify (widget &rest ignore) (epa-show-key (widget-value widget))) -(defun epa-mark () +(defun epa-mark (&optional arg) "Mark the current line." - (interactive) + (interactive "P") (let ((inhibit-read-only t) buffer-read-only properties) (beginning-of-line) (setq properties (text-properties-at (point))) (delete-char 1) - (insert "*") + (insert (if arg " " "*")) (set-text-properties (1- (point)) (point) properties) (forward-line))) -(defun epa-unmark () +(defun epa-unmark (&optional arg) "Unmark the current line." - (interactive) - (let ((inhibit-read-only t) - buffer-read-only - properties) - (beginning-of-line) - (setq properties (text-properties-at (point))) - (delete-char 1) - (insert " ") - (set-text-properties (1- (point)) (point) properties) - (forward-line))) + (interactive "P") + (epa-mark (not arg))) (provide 'epa)