From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qG8lMRnK2GSufQAASxT56A (envelope-from ) for ; Sun, 13 Aug 2023 14:18:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oPUBMRnK2GRiEAAA9RJhRA (envelope-from ) for ; Sun, 13 Aug 2023 14:18:33 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B85814D274 for ; Sun, 13 Aug 2023 14:18:31 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lbl-gov.20221208.gappssmtp.com header.s=20221208 header.b=cOEYu6b+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lbl.gov (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691929113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=PlSdh+6EkmK1D5FRiBOzxcXMkNIDz8mQ84wgXVuJJY4=; b=F1chaqG75wgTLuQJn1tMVDDweef3tw9HJDRyvntUPUOXyVfRXKdnYrp3nXM+IiYZTLWaLe K9RpZF7vog6Paxe2gYJMO9QMkl0P1uJ2z4lEo6d1UvzSSxGDxlRZvr9pWetJy3TzneHA6+ ztpczAVszdBvebaCMpXwqTIpPfkIf9a78bnP+gAprineFsHTOBpJbBPwsQ9B+zolUcbNeL uv+GiReG02cvG6ObKrBC3yEDuOmMCfAqrDn/2M0JSvTeUginZ+xdyvW7FggCfcP3iCRr+l WHXjtKOROK6zPoffDp+TJnkjtmxq4hVPVLA/lrieeOsqx28qrSz/k7SPWq6dLw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=lbl-gov.20221208.gappssmtp.com header.s=20221208 header.b=cOEYu6b+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lbl.gov (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691929113; a=rsa-sha256; cv=none; b=sZs86dU+criNerZHk5d1iB2Tm3UImcJDI2VbsQVCYfNu6IX/9ItB37Dlvtt6ofubf8cvK8 WlUnhUCcWnjzNJLRbiKfQl0TNuqfxXKA3EUtUZZbu7qkY4tf5HEuE3Vw7yYfn5Ph8h0nsM mulbnZiIcW2TB9UmLu0ILA29cx35sv7Em9tBrpukIukorKBCyYFRXcdtJqnGKCKX6OAuSw 7+8CfiLDW452cBP81/NmEuSps2wWPleymO2j5ggjlj5DEYZTsiC3Ophu5A6yPUJXN1yYS5 9XJT0QXSKb74Gz7h/nl9C63ZGTS8SLDPxGs4/kCWmkKKwqfaDepQ6/bzdbqvaw== Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 89ACB5E021; Sun, 13 Aug 2023 12:18:28 +0000 (UTC) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by mail.notmuchmail.org (Postfix) with ESMTPS id 339DD5F5E2 for ; Sat, 12 Aug 2023 17:02:31 +0000 (UTC) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bc83a96067so19235875ad.0 for ; Sat, 12 Aug 2023 10:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lbl-gov.20221208.gappssmtp.com; s=20221208; t=1691859749; x=1692464549; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=g3uwl0auMYWSU4ul/zKcYWmEnpk/0auJt7XziIdYXPk=; b=cOEYu6b+Apig97gedOIiZo5/o9TExRa6Jk66XSOYu8BGN6mWa7bO1xCr9XpYllbXx9 oXu/OUdgYo7HMMFScL7KwxgTlx37CmIbLFJ340rqH1BheG6X5M9lmDkntddfNBl9+9qc DGXLVMwjCds1p5LMGSSzHPkYtWrydJlDOjTkzpTaM57JltsrDYhxNz1fPrSCVxOtLkw2 9+T3KpxXEqg2aIwTXcUJ6xuIuBj6nNRrt79JxdOd52rf8acw1bKjHx4+VeU+xKStGlpb jOVoPkFF7TTbrkb4s+n/R+ldUt1SKKWgTDDx1g2TQVOfGbarVpncwHIus6ozz5Jj/eZL LgzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691859749; x=1692464549; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g3uwl0auMYWSU4ul/zKcYWmEnpk/0auJt7XziIdYXPk=; b=l3WFgHuNaSNDxRJkXfaxMG66stbMvgsGtAj0DIJD8Euc7snHLosbrZ0mSZrvZ8VhCn hxFvMVNNHrGurh4jI+P70nSL7SwnJQv8eiwvgC6MXOrxrD+27LMIUSRG4lx4lgEXmdSy fkonxWgE0/Qh5O6lERByDMXp6jdYqPi8/GfhsrTjinrnBXXeCwAJhGehsRh6HgvsSU4h HVacR5fyVuhP2aUCtepzgQc0osYUXIN13WjX9G8toRjIo2eJTEnVGG5jimNzhaXYqJyC py4Xje9SSAqe9fwmq7+mAtVYapETojfp3gbVr2c916kdhdbP8LT28c+vXZhHoqxBKbaU CKzQ== X-Gm-Message-State: AOJu0YxY7Qfx010q6Ot2Ecxl6KhCgwMo4Fl1Yf9+DXz3Sn51qRg+1GBW PyZ96hzsYp5A4bcY+VMJDWPCyi3euqZ1rqYpP35aM8o/n7aaw/EDvy6ic80QqiwpWaw52uVUDKW jzajz8iUZVXri32BOAaTuprMNU9+BUUZveVsSSe3q5iMyty/iBLYinF7d2GE7Gxi1xdFtlfAMY8 yt1M7XgyC57VFa3RgqHtZPvd1W X-Google-Smtp-Source: AGHT+IHX0fmpmOBitJL2Kx8LfE4vjKcgdFVd88zlztpWKfa8z8IIVa1qnaRkrm4VuKB3W7i+kTGtpA== X-Received: by 2002:a17:903:2290:b0:1b8:b433:7fa with SMTP id b16-20020a170903229000b001b8b43307famr4694942plh.13.1691859749195; Sat, 12 Aug 2023 10:02:29 -0700 (PDT) Received: from localhost (135-180-193-26.fiber.dynamic.sonic.net. [135.180.193.26]) by smtp.gmail.com with ESMTPSA id je22-20020a170903265600b001bb33ee4057sm6130611plb.43.2023.08.12.10.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Aug 2023 10:02:28 -0700 (PDT) From: Jon Rubens To: Preston Miller Firestone <0x504d46@disroot.org>, notmuch@notmuchmail.org Subject: Re: WIP: asynchronous notmuch-poll in emacs client In-Reply-To: <87ee36obxb.fsf@disroot.org> References: <87ee36obxb.fsf@disroot.org> Date: Sat, 12 Aug 2023 10:02:27 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-MailFrom: jon@lbl.gov X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: FDUKLGMRA6NNPJIA44SS4P5GGEP6UCFV X-Message-ID-Hash: FDUKLGMRA6NNPJIA44SS4P5GGEP6UCFV X-Mailman-Approved-At: Sun, 13 Aug 2023 12:18:27 +0000 X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE X-Migadu-Spam-Score: -1.23 X-Spam-Score: -1.23 X-Migadu-Queue-Id: B85814D274 X-Migadu-Scanner: mx2.migadu.com X-TUID: Xdw+wwW8oMN2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Preston Miller Firestone <0x504d46@disroot.org> writes: > a. notmuch-start-notmuch warns the user about everything, while > notmuch-call-notmuch-process only warns on errors. I don=E2=80=99t see any errors using a nearly similar approach. This might = be from more async support in emacs. > b. notmuch-poll-and-refresh-this-buffer doesn't know that notmuch-poll > is now asynchronous and so refreshes too early. I adjusted your sentinel to handle the refresh. Had to take the refresh call out of notmuch-poll. > c. The call to notmuch-poll-script is still synchronous, but that's a > WIP.=20 That variable is deprecated now so probably not worth fixing? modified emacs/notmuch-lib.el @@ -278,6 +278,7 @@ displays both values separately." ;;; Commands +;;;###autoload (defun notmuch-poll () "Run \"notmuch new\" or an external script to import mail. @@ -289,8 +290,11 @@ depending on the value of `notmuch-poll-script'." (unless (string-empty-p notmuch-poll-script) (unless (equal (notmuch--call-process notmuch-poll-script nil nil) 0) (error "Notmuch: poll script `%s' failed!" notmuch-poll-script))) - (notmuch-call-notmuch-process "new")) - (message "Polling mail...done")) + (notmuch-start-notmuch "*notmuch-sync*" + nil + (lambda (proc string) + (notmuch-refresh-this-buffer) + (message "Polling mail async...done")) "new"))) (defun notmuch-bury-or-kill-this-buffer () "Undisplay the current buffer. @@ -467,7 +471,8 @@ of its command symbol." "Invoke `notmuch-poll' to import mail, then refresh the current buffer." (interactive) (notmuch-poll) - (notmuch-refresh-this-buffer)) + ;; (notmuch-refresh-this-buffer) + ) (defun notmuch-refresh-all-buffers () "Invoke `notmuch-refresh-this-buffer' on all notmuch major-mode buffers. --=20 Jon Rubens --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --=-=-=--