From: ueno Date: Thu, 20 Apr 2006 09:47:29 +0000 (+0000) Subject: * epa.el (epa-list-keys-1): Add 'epa-list-keys property to keylist X-Git-Tag: epgsm-branchpoint~8 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5944a44f16964313efa58244a1ad0e62f32237fb;p=elisp%2Fepg.git * epa.el (epa-list-keys-1): Add 'epa-list-keys property to keylist region. --- diff --git a/ChangeLog b/ChangeLog index 6bb926d..f0ee038 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-04-20 Daiki Ueno + * epa.el (epa-list-keys-1): Add 'epa-list-keys property to keylist + region. + +2006-04-20 Daiki Ueno + * pgg-epg.el (pgg-epg-secret-key-id-list): New variable. (pgg-epg-passphrase-callback): New function. diff --git a/epa.el b/epa.el index c95480e..043ffd6 100644 --- a/epa.el +++ b/epa.el @@ -254,8 +254,15 @@ (setq epa-keys-buffer (generate-new-buffer "*Keys*"))) (set-buffer epa-keys-buffer) (let ((inhibit-read-only t) - buffer-read-only) - (erase-buffer) + buffer-read-only + (point (point-min))) + (unless (get-text-property point 'epa-list-keys) + (setq point (next-single-property-change point 'epa-list-keys))) + (when point + (delete-region point + (or (next-single-property-change point 'epa-list-keys) + (point-max))) + (goto-char point)) (epa-list-keys-1 name mode) (epa-keys-mode)) (make-local-variable 'epa-list-keys-arguments) @@ -264,17 +271,20 @@ (pop-to-buffer (current-buffer))) (defun epa-list-keys-1 (name mode) - (let ((inhibit-read-only t) - buffer-read-only - (keys (epg-list-keys name mode)) - point) - (while keys - (setq point (point)) - (insert " ") - (put-text-property point (point) 'epa-key (car keys)) - (widget-create 'epa-key :value (car keys)) - (insert "\n") - (setq keys (cdr keys))))) + (save-restriction + (narrow-to-region (point) (point)) + (let ((inhibit-read-only t) + buffer-read-only + (keys (epg-list-keys name mode)) + point) + (while keys + (setq point (point)) + (insert " ") + (put-text-property point (point) 'epa-key (car keys)) + (widget-create 'epa-key :value (car keys)) + (insert "\n") + (setq keys (cdr keys)))) + (put-text-property (point-min) (point-max) 'epa-list-keys t))) (defun epa-marked-keys () (or (save-excursion @@ -464,10 +474,7 @@ If no one is selected, symmetric encryption will be performed. "))) (let ((cipher (concat file ".gpg")) (context (epg-make-context))) (message "Encrypting %s..." (file-name-nondirectory file)) - (epg-encrypt-file context - file - recipients - cipher) + (epg-encrypt-file context file recipients cipher) (message "Encrypting %s...done" (file-name-nondirectory file)))) (defun epa-delete-keys (keys)