emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does Gnus article-moving act like a fetch of new news?


From: Eric Abrahamsen
Subject: Re: Why does Gnus article-moving act like a fetch of new news?
Date: Fri, 09 Apr 2021 21:11:20 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Karl Fogel <kfogel@red-bean.com> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]