If I try to open an larger imap group (a few thousand messages both read and unread) Gnus gives a warning: Wrong number of arguments: #, 2 And the Summary window is empty or it contains only some of the messages.

Compile Log shows: Warning: ‘not’ called with 2 args, but requires 1

If I limit the number of messages to fetch to e.g. 200 (C-u RET) it works fine. Limiting to 500 triggers the same warning.

The problem shows up with different imap servers, both for emacs 26 and 27. The gnus config is fairly basic, just nnimap sources with gnus-secondary-select-methods and gnus-posting-styles.

imap log shows: 23:56:34 [poczta.agh.edu.pl] 122 UID FETCH 107408,107410,107415,107424:107425,107431,107448:107449,107453,107463,107469:107470,107472:107473,107489,107495,107511,107519,107522,107524,107526:107542,107545:107547,107549:107553,107559:107561,107564,107569:107573,107576,107580,107586,107592,107594:107595,107629,107635:107638,107652:107655,107661,107664,107689,107695,107698:107699,107702,107706,107711,107716:107717,107723,107732,107746,107752:107755,107757,107773,107775,107779....,111987,111999:112015,112017:112050 (UID RFC822.SIZE BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Subject From Date Message-Id References In-Reply-To Xref To Newsgroups Cc)])

Any thoughts on how to fix it or what's wrong?

  • (setq debug-on-error t), reproduce the issue, then use M-x report-emacs-bug , insert the backtrace, send to the Emacs developers.
    – rpluim
    Sep 18, 2020 at 9:00

1 Answer 1


It was my badly formed sort function. I had:

(setq gnus-thread-sort-functions '(not gnus-thread-sort-by-most-recent-date))

which should be:

(setq gnus-thread-sort-functions '((not gnus-thread-sort-by-most-recent-date)))

  • If you accept your own answer, stackexchange will stop reminding us about your question :-)
    – rpluim
    Oct 20, 2020 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.