Re: feature request: fetch missing keys in the background

Subject:Re: feature request: fetch missing keys in the background

Date:Mon, 03 Sep 2018 17:46:00 +0100

To:Antoine Beaupré ,notmuch@notmuchmail.org

Cc:

From:David Edmondson


On Monday, 2018-09-03 at 11:49:09 -04, Antoine Beaupré wrote:

> Hi!
>
> Because I have a rather large keyring, fetching new keys or refreshing
> old ones takes a long time. When I click on the red red button saying
> "Unknown key ID [...] or unsupported algorithm", Emacs freezes for a
> good 90 seconds. Considering I use that editor^Wvirtual machine for
> nearly everything, it's quite annoying and sends me off browsing the web
> in Firefox forever. I end up having a horde of shaven yaks and then
> finally remember that I had that key update, by which time I had
> forgotten what I was doing reading email in the first place, let alone
> what I was doing *before* opening my inbox...
>
> So. It would be great if Notmuch would run those key updates
> asynchronously. I am not sure how that would work: as Bremner said on
> IRC, it might make it difficult to update the button automatically. But
> I don't mind that: I can refresh the page myself. He suggested running
> things in the background when clicking with a prefix (C-u?) but I would
> argue that freezing Emacs is just a no-no in general.
>
> I couldn't find directly what function was called behind that button:
> "C-h k" just says it's, obviously, `push-button'. Bremner says it might
> be `notmuch-crypto-sigstatus-good-callback' which looks reasonable. I'm
> only a junior elisp programmer, but it seems to me the
> `notmuch-show-refresh-view' call there could be an asynchronous callback
> to an async `make-process' call, as opposed to `call-process', which is
> synchronous.
>
> But I'd like others to chime in here: is this something that would be
> accepted? Would the above work?

I'm puzzled about the currently expected behaviour based on your
question.

I have “notmuch-crypto-process-mime” set to t.

I *don't* have “keyserver-options auto-key-retrieve” set in my gpg.conf,
so I don't expect to get any automatic retrieval of keys (it was
annoyingly slow sometimes).

When I read a message with a signature using a key that I don't have, I
get the expected “Unknown key ID ...” button. If I click on that button
a new window appears showing me the details of that key (with a slight
delay).

The referenced key is *not* imported into my keyring, so updating the
view of the message does nothing to change the display of the button -
it still says “Unknown key ID ...”.

Enabling “auto-key-retrieve” changes this behaviour, as you would expect
(I see a delay opening the message while the key is retrieved, and then
the button shows it as good).

(Caveat: I'm using “remote-notmuch”, so emacs and notmuch/gpg are on
different machines, but I don't know that this changes any of the
above.)

dme.
-- 
She's as sweet as Tupelo honey, she's an angel of the first degree.
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: