Subject: Group parameters can't set non-list values

From: Tim Landscheidt <[email-masked]>
Date: Wed, 15 Mar 2017 10:34:18 +0000

With Gnus v5.13/GNU Emacs 25.1.1, I want to customize for
example gnus-summary-thread-gathering-function to
gnus-gather-threads-by-references for one specific group.
When I use either of:

| (gnus-summary-thread-gathering-function . gnus-gather-threads-by-references)

or:

| (gnus-summary-thread-gathering-function gnus-gather-threads-by-references)

in G p, the variable gnus-summary-thread-gathering-function
is unchanged in the summary buffer, i. e. the customization
is ignored.  When I use the syntax:

| (gnus-summary-thread-gathering-function
|   '(gnus-gather-threads-by-references)))

on trying to enter the group, Gnus fails with
"gnus-summary-prepare: Invalid function:
(gnus-gather-threads-by-references)".

This is due to:

a) gnus-summary-prepare calling
   gnus-summary-thread-gathering-function with:

   | (funcall gnus-summary-thread-gathering-function
   | 		     (gnus-sort-threads
   | 		      (gnus-cut-threads (gnus-make-threads))))

   i. e. it expects gnus-summary-thread-gathering-function
   to be a single function, and

b) gnus-summary-set-local-parameters only setting variables
   in group parameters if the value is a list and silently
   ignoring non-list values:

   |     (dolist (elem (gnus-group-find-parameter group))
   |       (and (consp elem)			; Has to be a cons.
   | 	   (consp (cdr elem))		; The cdr has to be a list.
   | 	   (symbolp (car elem))		; Has to be a symbol in there.
   | 	   (not (memq (car elem) vars))
   |          […]

AFAICT, this requirement has been introduced by Lars with
commit eec82323c2e3610907cf66ece372b1920318d460 ("Initial
revision" :-)).  This is only alluded to in info's "2.10
Group Parameters":

|    We see that each element consists of a “dotted pair”—the thing before
| the dot is the key, while the thing after the dot is the value.  All the
| parameters have this form _except_ local variable specs, which are not
| dotted pairs, but proper lists.

IMHO this behaviour is surprising and makes customizing non-
list variables for groups unnecessarily complicated; it
should be changed so that all values can be set.

If Gnus differentiates between two types of parameters as
the info suggests, IMHO this would be better done by compar-
ing (car elem) to a white-list of parameters to be treated
differently.