- (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)))))
-
-(defun epa-select-keys (prompt &optional names)
+ (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
+ (set-buffer epa-keys-buffer)
+ (goto-char (point-min))
+ (let (keys key)
+ (while (re-search-forward "^\\*" nil t)
+ (if (setq key (get-text-property (match-beginning 0)
+ 'epa-key))
+ (setq keys (cons key keys))))
+ (nreverse keys)))
+ (save-excursion
+ (beginning-of-line)
+ (get-text-property (point) 'epa-key))))
+
+(defun epa-select-keys (prompt &optional names mode)