A similar pattern is used by `gnus-article-sort-by-author', but I didn't see an easy way to unify these without also passing around functions by header type. Also, I haven't used `defsubst' before, so I leave it up to you if it makes sense to use that for the `gnus-article-sort-by-newsgroups' and `gnus-article-sort-by-newsgroups', respectively. Thanks! -- Alex.