Re: Agent and IMAP

James Thomas <[email protected]> Sat, 12 Oct 2024 17:01:19 +0530
Newsgroups gmane.emacs.gnus.general
Message-ID <[email protected]>
Divya Ranjan wrote:

> James Thomas writes:
>
>> No, because I use it daily.
>
> Would you be willing to share your configuration?

I don't have any Agent-related configuration. Just do 'J a' on the
nnimap server in the *Server* buffer.

The next time you open the group and read an article, it'll be saved
(the docs of (info "(gnus) Agent Caveats") have recently been updated).
Then you can unplug ('J j') and then enter the group when offline to
read them.

>> Was it 'nnimap that you added to it?
>
> Yes

OK. Though it seems to need only that, I can't help more because I don't
use it that way.

>> I did it as per (info "(gnus) Agent Basics"):
> I also have it set according to that, but then when I look at (info
> "(gnus) (Gnus Unplugged) Agent and IMAP"), it says the following:
>
>> The Agent works with any Gnus back end, including nnimap. However,
>> since there are some conceptual differences between NNTP and IMAP,
>> this section (should) provide you with some information to make Gnus
>> Agent work smoother as a IMAP Disconnected Mode client

Well, "smooth*er*": not that it doesn't work, no? (It's only an
introduction to what follows).

> Let me know more about how you’ve set gnus with IMAP using 'nnimap.

FWIW the only remotely related part of my config is my gnus-daemon
function, which uses Agent features (comments added):

--8<---------------cut here---------------start------------->8---
(defun my/gnus-demon-scan-mail ()
  (gnus-agent-while-plugged
    ;; Only level 3 servers should be agentized, for this.
    (gnus-agent-synchronize-flags)
    ;; Inbox.
    (gnus-group-get-new-news 3 t)
    (with-temp-message ""
      ;; Spam.
      (gnus-group-get-new-news 4 t)
      (gnus-agent-fetch-session))
    (unless (equal (current-message) gnus-no-groups-message)
      ;; Custom alert function.
      (alert))
    (call-interactively #'gnus-group-list-groups)))

(gnus-demon-add-handler 'my/gnus-demon-scan-mail 90 11)
--8<---------------cut here---------------end--------------->8---

...for my workflow: to mark messages (for future downloading as well) if
I'm checking later when offline.

Oh, and I have a 'downloaded mark' in my Summary line:

--8<---------------cut here---------------start------------->8---
(setq gnus-summary-line-format
"%U%R%O %-16&user-date; %3i %*%B%«%-23,23n%»%T: %s\n")
--8<---------------cut here---------------end--------------->8---

Regards,
James