aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/epa.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/epa.el')
-rw-r--r--lisp/epa.el51
1 files changed, 26 insertions, 25 deletions
diff --git a/lisp/epa.el b/lisp/epa.el
index 609ac5d1917..25e055c201f 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -435,33 +435,34 @@ q trust status questionable. - trust status unspecified.
435 (unless (and epa-keys-buffer 435 (unless (and epa-keys-buffer
436 (buffer-live-p epa-keys-buffer)) 436 (buffer-live-p epa-keys-buffer))
437 (setq epa-keys-buffer (generate-new-buffer "*Keys*"))) 437 (setq epa-keys-buffer (generate-new-buffer "*Keys*")))
438 (with-current-buffer epa-keys-buffer 438 (save-window-excursion
439 (epa-key-list-mode) 439 (with-current-buffer epa-keys-buffer
440 ;; C-c C-c is the usual way to finish the selection (bug#11159). 440 (epa-key-list-mode)
441 (define-key (current-local-map) "\C-c\C-c" 'exit-recursive-edit) 441 ;; C-c C-c is the usual way to finish the selection (bug#11159).
442 (let ((inhibit-read-only t) 442 (define-key (current-local-map) "\C-c\C-c" 'exit-recursive-edit)
443 buffer-read-only) 443 (let ((inhibit-read-only t)
444 (erase-buffer) 444 buffer-read-only)
445 (insert prompt "\n" 445 (erase-buffer)
446 (substitute-command-keys "\ 446 (insert prompt "\n"
447 (substitute-command-keys "\
447- `\\[epa-mark-key]' to mark a key on the line 448- `\\[epa-mark-key]' to mark a key on the line
448- `\\[epa-unmark-key]' to unmark a key on the line\n")) 449- `\\[epa-unmark-key]' to unmark a key on the line\n"))
449 (insert-button "[Cancel]" 450 (insert-button "[Cancel]"
450 'action (lambda (_button) (abort-recursive-edit))) 451 'action (lambda (_button) (abort-recursive-edit)))
451 (insert " ") 452 (insert " ")
452 (insert-button "[OK]" 453 (insert-button "[OK]"
453 'action (lambda (_button) (exit-recursive-edit))) 454 'action (lambda (_button) (exit-recursive-edit)))
454 (insert "\n\n") 455 (insert "\n\n")
455 (epa--insert-keys keys) 456 (epa--insert-keys keys)
456 (setq epa-exit-buffer-function #'abort-recursive-edit) 457 (setq epa-exit-buffer-function #'abort-recursive-edit)
457 (goto-char (point-min)) 458 (goto-char (point-min))
458 (let ((display-buffer-mark-dedicated 'soft)) 459 (let ((display-buffer-mark-dedicated 'soft))
459 (pop-to-buffer (current-buffer)))) 460 (pop-to-buffer (current-buffer))))
460 (unwind-protect 461 (unwind-protect
461 (progn 462 (progn
462 (recursive-edit) 463 (recursive-edit)
463 (epa--marked-keys)) 464 (epa--marked-keys))
464 (kill-buffer epa-keys-buffer)))) 465 (kill-buffer epa-keys-buffer)))))
465 466
466;;;###autoload 467;;;###autoload
467(defun epa-select-keys (context prompt &optional names secret) 468(defun epa-select-keys (context prompt &optional names secret)