From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Why does Gnus article-moving act like a fetch of new news? Date: Fri, 09 Apr 2021 16:47:10 -0500 Message-ID: <87lf9rruzl.fsf@red-bean.com> Reply-To: Karl Fogel Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5935"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 09 23:48:46 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 1lUyze-0001QY-CT for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 23:48:46 +0200 Original-Received: from localhost ([::1]:52614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUyzd-0003wt-2D for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 17:48:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUyyE-0003Vu-GE for emacs-devel@gnu.org; Fri, 09 Apr 2021 17:47:18 -0400 Original-Received: from sanpietro.red-bean.com ([45.79.25.59]:43250) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUyyA-0003Bc-RV for emacs-devel@gnu.org; Fri, 09 Apr 2021 17:47:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=red-bean.com; s=202005newsp; h=Content-Type:MIME-Version:Message-ID:Date: Reply-To:Subject:To:From:Sender:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=RDiuiRcR44kZaGLNEdw2rIBvo3i0cgZZVfR1WoXB6GM=; t=1618004832; x=1619214432; b=gEEzp1i8CUxpy5C+nYf2su2FPdepFtBXgBPvONi7m5l7Z9dJYECS1rmLfg3KpIuRQU3UALditB p39Tj1TCDtsuPnaqb1h0yeal6tz1EUfCAoy9XZjEMA6HC7L88zGgMp1hYRyIL09s9bv8zAFsDXBia RDhsWExGbQvLTmiZ85sX8d2fFpMGvt1VXs+8gfhGSK8qFF2f/JY9vZGecDs+PCZovH0+Q+uymefso rObRfcP9keHgav9nWwXXCpxCvp7PCSYJEYdL5zobc5KJ3E6+iafy6MlQRG+NtQxYaWWWlZ0pgn+JA 6gTxuHJZPgiXwG/GwcDxhPTz3UbMbaLTZvjzw==; Original-Received: from [12.106.183.66] (port=14714 helo=kwork) by sanpietro.red-bean.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lUyy7-0004Ab-4A for emacs-devel@gnu.org; Fri, 09 Apr 2021 21:47:11 +0000 Received-SPF: pass client-ip=45.79.25.59; envelope-from=kfogel@red-bean.com; helo=sanpietro.red-bean.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-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:267749 Archived-At: 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'm not expert in Gnus internals; I hope someone who knows more (Lars?) can comment. Best regards, -Karl