From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D8D476DE0273 for ; Mon, 3 Sep 2018 08:58:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.234 X-Spam-Level: X-Spam-Status: No, score=-0.234 tagged_above=-999 required=5 tests=[AWL=-0.234, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dDDF0HCADYV4 for ; Mon, 3 Sep 2018 08:58:21 -0700 (PDT) X-Greylist: delayed 548 seconds by postgrey-1.36 at arlo; Mon, 03 Sep 2018 08:58:20 PDT Received: from marcos.anarc.at (marcos.anarc.at [206.248.172.91]) by arlo.cworth.org (Postfix) with ESMTPS id A27E96DE023E for ; Mon, 3 Sep 2018 08:58:20 -0700 (PDT) Received: by marcos.anarc.at (Postfix, from userid 1000) id ADBB210E209; Mon, 3 Sep 2018 11:49:09 -0400 (EDT) Received: by curie.anarc.at (Postfix, from userid 1000) id 4A2E6126670; Mon, 3 Sep 2018 11:49:09 -0400 (EDT) From: =?utf-8?Q?Antoine_Beaupr=C3=A9?= To: notmuch@notmuchmail.org Subject: feature request: fetch missing keys in the background Date: Mon, 03 Sep 2018 11:49:09 -0400 Message-ID: <871saawphm.fsf@curie.anarc.at> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2018 15:58:22 -0000 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? A. -- If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet. - Niels Bohr