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 A963C6DE0A43 for ; Sat, 19 Jan 2019 03:15:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.33 X-Spam-Level: X-Spam-Status: No, score=0.33 tagged_above=-999 required=5 tests=[AWL=-0.323, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001] 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 bDt_C_QpZsvx for ; Sat, 19 Jan 2019 03:15:15 -0800 (PST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by arlo.cworth.org (Postfix) with ESMTPS id E6B256DE098A for ; Sat, 19 Jan 2019 03:15:14 -0800 (PST) Received: by mail-wm1-f68.google.com with SMTP id y8so6732057wmi.4 for ; Sat, 19 Jan 2019 03:15:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=to:subject:in-reply-to:references:from:date:message-id:mime-version; bh=Zrs6fyoXWTTn+idQ75+kNzQyCn/w0WZBZOsrGMwiDz0=; b=StXA4+IOsJDfAsDHgqjiFcv2xpZX7fjRTLZ/mIMkqKlw1pGglLLtAytt8CFXzT5CNY xqXAESYcTI96LEeODM2ggu3jfOP4AnDBAjmV8TnqbeapBHajanQSnw+yFwcjUnixF/Wb KAd2zl6tStOKOu8l3b019BiQnqaT78g38XoFhupr/n+U9mYsVj1OMUXF3Gs+eFH6piP1 KP0coVvGar1H2C+2bmfPS4grQnJLFWcXcD+9dK+mv3xiQo5FerAC5A87GpbRxxbV2UMS rvsuF4oLY/nQPza58s9uIiYvXuHBkXHyXIHfKMnHhMyA+b99XqOGk0JDiBLk60HUxOYL nj/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:in-reply-to:references:from:date :message-id:mime-version; bh=Zrs6fyoXWTTn+idQ75+kNzQyCn/w0WZBZOsrGMwiDz0=; b=m8dxenuKLnEj73lKJ0WamBuE9EPztY5v2htSFmJzlt+hPvEpIQP8VEehexY/Ge9UcH d6O6SJlUtYGjzyRg3BrrtxO5l8+V2V6x9cegv3WfDrdG8BYyfZH/ONPAu5GwWnXugOf4 rAIu2BptDjvyXMmCl4X5jjpoULVjKWbSzyeekWI8OEgbQTuOfJg3TQ4mNFLfUV48NbpB 7XZ5lJGX4ySDtjAnJp5Bwr4CMiQrA3qkfLphzSQw20bO4x2iIgjUSyKuwaEVLBDMFWVQ 02r3REdElrYAhDTtsiPSlBn8SlPNqQnrT8KTJ+lyCvdKxLVhwXGQfoT/xZTwTdXXAzLM 5mpg== X-Gm-Message-State: AJcUukeghJfTmfrxSD/WMWKbpM/lgFCEzPUOBD6FoMmFRpeONc+muv+x ut1xgKbLiLWFkH/OdsAKvileFzOXiWg= X-Google-Smtp-Source: ALg8bN6TcujAArUqH9epfATsGMMr8EP2NuHj86YgNKKYsKV10wxXoZhNIPF7u3ylmYG6B0XqY/OSIw== X-Received: by 2002:a1c:2b01:: with SMTP id r1mr18247060wmr.7.1547896513090; Sat, 19 Jan 2019 03:15:13 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id k3sm123610776wrm.7.2019.01.19.03.15.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Jan 2019 03:15:12 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id a9e058ce; Sat, 19 Jan 2019 11:15:11 +0000 (UTC) To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH v3 1/4] emacs: Asynchronous retrieval of GPG keys In-Reply-To: <87y37msmep.fsf@tethera.net> References: <20181001160633.26775-1-dme@dme.org> <20181001160633.26775-2-dme@dme.org> <87y37msmep.fsf@tethera.net> X-HGTTG: zarniwoop From: David Edmondson Date: Sat, 19 Jan 2019 11:15:11 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Sat, 19 Jan 2019 11:15:16 -0000 On Monday, 2019-01-14 at 22:08:14 -04, David Bremner wrote: > David Edmondson writes: > >> Rather than blocking emacs while gpg does its' thing, by default run >> key retrieval asynchronously, possibly updating the display of the >> message on successful completion. >> --- >> emacs/notmuch-crypto.el | 85 +++++++++++++++++++++++++++++++++++------ >> 1 file changed, 74 insertions(+), 11 deletions(-) >> >> diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el >> index fc2b5301..c20fd4f8 100644 >> --- a/emacs/notmuch-crypto.el >> +++ b/emacs/notmuch-crypto.el >> @@ -43,6 +43,11 @@ mode." >> :package-version '(notmuch . "0.25") >> :group 'notmuch-crypto) >> >> +(defcustom notmuch-crypto-get-keys-asynchronously t >> + "Retrieve gpg keys asynchronously." >> + :type 'boolean >> + :group 'notmuch-crypto) >> + > > Sorry for the long delay. Should this have a :package-version key like > the defcustom right about it? Okay. >> + (buffer (get-buffer-create "*notmuch-crypto-gpg-out*"))) >> + (if notmuch-crypto-get-keys-asynchronously >> + (progn >> + (notmuch-crypto--set-button-label >> + button (format "Retrieving key %s asynchronously..." keyid)) >> + (let ((p (make-process :name "notmuch GPG key retrieval" >> + :buffer buffer >> + :command (list epg-gpg-program "--recv-keys" keyid) >> + :connection-type 'pipe >> + :sentinel #'notmuch-crypto--async-key-sentinel >> + ;; Create the process stopped so that >> + ;; we have time to store the key id, >> + ;; etc. on it. >> + :stop t))) > > Using make-process unconditionally seems to require emacs 25. I think > we're still trying to support Emacs 24. That can always change, but I > still haven't merged Tomi's patch officially deprecating emacs 23. Would you accept something like: (defcustom notmuch-crypto-get-keys-asynchronously (functionp 'make-process) ...) ? dme. -- I had my eyes closed in the dark.