I spent a good few hours trying to convince [Gnus](http://www.gnus.org) to search my IMAP folders, under XEmacs. Googling turned up quite a lot of stuff, but most of it is wrong/irrelevant. In the end all I needed to do was:
- stick `(require ‘nnir)` in my XEmacs init file
- add `(nnir-search-engine imap)` to my `.gnus` file, like so:
- re-byte-compile the `nnir.el` file in the XEmacs package directory for gnus – on my system that is `/usr/share/xemacs21/xemacs-packages/lisp/gnus`. For some reason the `nnir.elc` that comes with the XEmacs gnus package is broken, so unless it gets produced afresh the use of nnir results in mysterious errors.
After that, marking groups in the group buffer and hitting `G G` prompts for a search string and proceeds to carry out the search. Nice.