Subject: bug#44134: 28.0.50; epa-list-keys failing with ‘wrong type argument: interger-or-marker-p, nil’

From: Stephen Berman <[email-masked]>
Date: Thu, 22 Oct 2020 18:01:31 +0200

On Thu, 22 Oct 2020 15:21:54 +0100 Colin Baxter <[email-masked]> wrote:

>>>>>> Stephen Berman <[email-masked]> writes:
[...]
>     >> Do you want me to apply your patch to see if it makes any
>     >> difference?
>
>     > Yes, please do.
>
> Ok, patch applied to my setup and it appears to work.

Thanks for testing.

> emacs -Q <RET>
> M-x epa-list-keys <RET> --> keys listed
> q
> M-x epa-list-keys <RET> --> keys listed
> repeated 2 more times> --> same outcome
> repeated 2 more times using epa-list-secret-keys --> keys listed
>
> Would it be possible to use 'q' to kill the keys-buffer rather than hide
> it? That way, the buffer will not display an old duplicate listing.

Well, since `q' in epa-key-list-mode is bound to epa-exit-buffer, which
funcalls epa-exit-buffer-function, which is set by default to
quit-window, and the latter kills the buffer if called with a prefix
argument, you could just type `C-u q' instead of `q'.  Or if you want
`q' by itself to kill the buffer, putting either of the following sexps
into your init file should do the trick.

(with-eval-after-load "epa"
  (setq epa-exit-buffer-function
	(lambda () (interactive) (quit-window t))))

(with-eval-after-load "epa"
  (define-key epa-key-list-mode-map "q"
    (lambda () (interactive) (quit-window t))))

The latter affects only epa-key-list-mode, while the former has wider
scope, since epa-exit-buffer-function is used in several places in
epa.el.

Steve Berman