From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20250 invoked from network); 25 Sep 2020 06:06:20 -0000 Received: from lists1.math.uh.edu (129.7.128.208) by inbox.vuxu.org with ESMTPUTF8; 25 Sep 2020 06:06:20 -0000 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1kLgra-00GG99-9a; Fri, 25 Sep 2020 01:05:46 -0500 Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kLgrV-00GG7I-2v for ding@lists.math.uh.edu; Fri, 25 Sep 2020 01:05:41 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kLgrT-002Hd2-9q for ding@lists.math.uh.edu; Fri, 25 Sep 2020 01:05:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3BC2oLxzgDvkybemPMit9nF/Pxkza+pKSSvgOvezQUE=; b=poGu5XxZQmxNA24rJgfupOwUr1 SuheC+04YYQmon/ECPjrkGaJDsAAuSy5QC6SAsdAZzn9nZuC3LInqEsw4Wa+llTDGbZctpUzRlNUg TqM2DM+X32R81y1aImJMYEe8xtgbo54YX4ZKL5N0lwlcIWYfuceq/PdsyScFlH3uTxq0=; Received: from ericabrahamsen.net ([52.70.2.18] helo=mail.ericabrahamsen.net) by quimby with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLgrH-000786-AC for ding@gnus.org; Fri, 25 Sep 2020 08:05:34 +0200 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id D76EEFA5B6; Fri, 25 Sep 2020 06:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1601013924; bh=3BC2oLxzgDvkybemPMit9nF/Pxkza+pKSSvgOvezQUE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=LLs/GJuoeYBZQqtXcqrv+a8EvsN6ehNG2B7jOW8j9xvdIn/SfSZP4ybI7wtaWlGi/ sjQwpg9Qhze+xKI9WdSl0TkJixphiLu/QgcYVcePrdA8v9rI5b5K7tnMFDe6DFgTle Vel/tp2lHrQHPxtjjruqssZ1VeGX1pOwaw/L5hgo= From: Eric Abrahamsen To: Pankaj Jangid Cc: Adam =?utf-8?Q?Sj=C3=B8gren?= , ding@gnus.org Subject: Re: Does Gnus automatically run 'notmuch new' if configured? References: <875z83njo0.fsf@tullinup.koldfront.dk> Date: Thu, 24 Sep 2020 23:05:22 -0700 In-Reply-To: (Pankaj Jangid's message of "Fri, 25 Sep 2020 09:30:26 +0530") Message-ID: <87r1qq9ysd.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-ID: Precedence: bulk Pankaj Jangid writes: > On Thu, Sep 24 2020, Adam Sj=C3=B8gren wrote: > >>> does Gnus automatically run "notmuch new" if notmuch is the configured >>> search engine. >> >> If you want it run every time you have fetched mail, I think you could >> add calling it to a hook, maybe gnus-after-getting-new-news-hook? > > Are hooks asynchronous? Eric had also suggested a similar solution. He > suggested to put this at the time of startup. But my question is - will > it increase the waiting time? I am fetching emails from multiple sources > and it already takes 4-5 seconds to fetch emails when I press 'g'. It's not the hook that's synchronous or asynchronous, it's the call to the external process. You can use `shell-command' for a synchronous call (probably not what you want), or `async-shell-command' for... async. The async call should return more or less instantly. I'm sure notmuch is capable of continuing to handle search queries while it's in the middle of an update, so there's not actually any harm in calling it more often, apart from burning CPU cycles. Otherwise, your wait while Gnus fetches new mail is totally unrelated to notmuch updating its index, as that happens in a completely separate process. HTH, Eric