From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Why does Gnus article-moving act like a fetch of new news? Date: Fri, 09 Apr 2021 21:11:20 -0700 Message-ID: <874kgekcd3.fsf@ericabrahamsen.net> References: <87lf9rruzl.fsf@red-bean.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23106"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Emacs Development To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 10 06:11:58 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lV4yU-0005u4-0I for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Apr 2021 06:11:58 +0200 Original-Received: from localhost ([::1]:51546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lV4yT-0002sv-1P for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Apr 2021 00:11:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lV4xy-0002TY-AY for emacs-devel@gnu.org; Sat, 10 Apr 2021 00:11:26 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:41000 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lV4xw-0003AM-Ht for emacs-devel@gnu.org; Sat, 10 Apr 2021 00:11:26 -0400 Original-Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 27853FA086; Sat, 10 Apr 2021 04:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1618027882; bh=G6s6DLZruqR2trukaP22Rfz+c0t9GlLcRHTkr+KAg5Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=K+kmvACBNFGY8HFZkValxj6kRZt6eTdK9CjLjuISiUcvhXidTNDKIDBKTN72iA3LQ hoYDMvWUwoDtTmhnX/YW9JjiBxPfX7Rwc2Vg6w5eIl7gWi1nLSIN9ljW9eloQB89h8 ep6zAhQB0INgBU8ZJvbzlF7/EVqXHgvcCEpBiZG4= In-Reply-To: <87lf9rruzl.fsf@red-bean.com> (Karl Fogel's message of "Fri, 09 Apr 2021 16:47:10 -0500") Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@ericabrahamsen.net; helo=mail.ericabrahamsen.net X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267766 Archived-At: Karl Fogel writes: > In lisp/gnus/gnus-sum.el, at the end of `gnus-summary-move-article', > there is this code: > > ;; Re-activate all groups that have been moved to. > (with-current-buffer gnus-group-buffer (let > ((gnus-group-marked to-groups)) > (gnus-group-get-new-news-this-group nil t))) I'm no expert in > this area of the code, but the above seems to conflate two > different things: > > a) It tells the destination group(s) that a new article has arrived, > and I guess that in turn "activates" the group? (My understanding > of activation in Gnus is somewhat fuzzy.) > > b) It also causes Gnus to run code that's involved in fetching new > news? At least, it definitely causes `gnus-get-new-news-hook' to be > run. > > The latter part of (b) surprised me. My `gnus-get-new-news-hook' runs > a function that contacts a remote server of mine to check something. > I expect Gnus to run that hook only when I actually fetch new news -- > like when I hit `g' in the Group buffer. But because of (b), that > hook is being run every time I move an article from one group to > another (thus making article-moving very slow, of course). I expected > article-moving to be an entirely local operation, and to have nothing > to do with fetching new news. After all, Gnus already has the article > in question -- it's not "new". > > One possibility is that I have wrong expectations about that hook. But > the hook's documentation says: > > "A hook run just before Gnus checks for new news." > > To me, that doesn't mean that the hook would run when I move an > article from one group to another :-). > > So I tentatively think this might indicate a problem in Gnus? At the > very least the hook's documentation might need to be updated. But it > also seems possible that Gnus is failing to make a distinction between > these two things: "fetch new news from outside sources (usually some > server somewhere)" > > versus > > "move an article that Gnus already had from one group to another" > > Are those two different actions sharing code that perhaps they > shouldn't share? I think an argument could be made that if the DONT-SCAN optional argument is non-nil, we should also skip running the two get-new-news hooks. But let's see what Lars says. Eric