Subject: Re: bug#65447: 30.0.50; Gnus: No such function: nnfolder-server-opened

From: Gerd Möllmann <[email-masked]>
Date: Tue, 22 Aug 2023 19:13:53 +0200

Eric Abrahamsen <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>>> From: Gerd Möllmann <[email-masked]>
>>> Date: Tue, 22 Aug 2023 09:29:39 +0200
>>> 
>>> Gerd Möllmann <[email-masked]> writes:
>>> 
>>> > I get the following error when starting Gnus with M-x gnus.
>>> >
>>> >   No such function: nnfolder-server-opened
>>> >
>>> > The function nnfolder-server-opened is indeed defined nowhere I can
>>> > find.  In case it matters, I had a Gnus autosave file.  After M-x gnus,
>>> > I answered 'n' to the question if the autosave file should be used.
>>> > After that, the error is signaled.
>
> This is almost certainly the source of the problem. Your .newsrc.eld
> file should have entries for groups looking like:
>
> ("nnfolder+archive:sent.2022-02" 3 ((1 . 1)) ((unexist) (seen 1))
>  (nnfolder
>   "archive" (nnfolder-directory "~/.mail/archive")
>   (nnfolder-active-file "~/.mail/archive/active")
>   (nnfolder-get-new-mail nil)
>   (nnfolder-inhibit-expiry t)))
>
> Long story short, at Gnus startup time the `nnfolder' symbol at the head
> of the method list will get turned into a `require' call for the
> appropriate library, so the nnfolder functions should be available early
> on.

My .newsrc.eld contains, among other stuff

(setq gnus-server-alist
      '(("archive" nnfolder "archive"
	 (nnfolder-directory "~/Mail/archive")
	 (nnfolder-active-file "~/Mail/archive/active")
	 (nnfolder-get-new-mail nil)
	 (nnfolder-inhibit-expiry t))))

(setq gnus-topic-topology '(("Gnus" visible) (("misc" visible))))

(setq gnus-topic-alist
      '(("misc"
	 "INBOX"
	 "Emacs"
	 "[Google Mail]/Entw\303\274rfe"
	 "[Google Mail]/Markiert"
	 "nndraft:drafts"
	 "[Google Mail]/Alle Nachrichten"
	 "[Google Mail]/Gesendet"
	 "[Google Mail]/Papierkorb"
	 "[Google Mail]/Spam"
	 "[Google Mail]/Wichtig"
	 "Notes" "[Gmail]/Drafts"
	 "Emacs/Emacs"
	 "nnfolder+archive:sent.2022-06")
	("Gnus")))

Above these, there's also a (setq gnus-newsrc-alist '(...)) with a large
list containomg references to nnfolder, e.g. (nnfolder-inhibit-expiry
t), but since that list is quoted...

> I'm not sure exactly how you got there, but it sounds like there are
> references to your nnfolder group(s) somewhere in Gnus, but the groups
> are not listed in your .newsrc.eld, so the library is never loaded.
>
> What nnfolder groups show up in your Group buffer (hitting "L" first).
> Are those groups present in your .newsrc.eld file?

and the summary shows

       0: Emacs
       0: Emacs/Emacs
       0: INBOX
       0: Notes
       0: [Gmail]/Drafts
*      0: [Google Mail]/Alle Nachrichten
       0: [Google Mail]/Entwürfe
*      0: [Google Mail]/Gesendet
*      0: [Google Mail]/Markiert
*U     0: [Google Mail]/Papierkorb
 U    72: [Google Mail]/Spam
       5: [Google Mail]/Wichtig
      13: nndraft:drafts
       2: nnfolder+archive:sent.2022-06
      24: nnfolder+archive:sent.2022-07
      31: nnfolder+archive:sent.2022-08
      71: nnfolder+archive:sent.2022-09
      57: nnfolder+archive:sent.2022-10
      15: nnfolder+archive:sent.2022-11
       7: nnfolder+archive:sent.2023-08

Which I think is what gnus-topic-alist has, except for the archives.

Here is what my .gnus looks like.  I think I copied it from
somewhere on the Internet.

(setq mml-secure-openpgp-signers '("xxx")
      ;; We want to be able to read the emails we wrote.
      mml-secure-openpgp-encrypt-to-self t)

(setq gnus-select-method
      '(nnimap "gmail"
	       (nnimap-address "imap.gmail.com")
	       (nnimap-server-port "imaps")
	       (nnimap-stream ssl)))

(setq smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 587)