Gnus development mailing list
 help / color / mirror / Atom feed
From: NAGY Andras <nagya@inf.elte.hu>
Subject: regexp-based group parameters
Date: 23 Feb 2001 17:41:19 +0100	[thread overview]
Message-ID: <dzc1ysps66o.fsf_-_@pandora.inf.elte.hu> (raw)
In-Reply-To: <878zp71ef0.fsf@lovi.inf.elte.hu> (NAGY Andras's message of "23 Dec 2000 13:59:47 +0100")

NAGY Andras <nagya@inf.elte.hu> writes:

> Some of the group options can be set based on group and topic
> parameters as well as on group regexps (say, total-expiry).  Others
> only based on parameters (banner).  And perhaps some only based on
> regexps. :)
> 
> Shouldn't there be a unified way for doing stuff like this?

Let's summarize once more: many functions in Gnus behave differently,
depending on which group they operate on.  There is (was?) a tendency
among these functions to introduce a custom variable, containing a
regexp, to be matched against group names, to decide which groups they
are supposed to deal width.  (Examples include
gnus-total-expirable-newsgroups, gnus-mailing-list-groups,
gnus-permanently-visible-groups etc).  Generally, a group matching or
not one of these regexps defines a boolean parameter for that group.

There are other type of such variables, regexp->something alists
(e.g. gnus-posting-styles) which assign a parameter to a group, based
on its name.

Besides this, there is the group/topic parameters mechanism, where
parameters can be assigned directly, or based on the groups place in
the topic hierarchy.  Furthermore, this info is stored in the newsrc
file instead of being customizable by the user through a config file.

Many (but not all, and even if yes, see below) Gnus functions (posting
styles, expiry, etc) allow the user to specify group parameters via
the gnus-group-find-parameter API as well as the "non-standard" custom
regexp way.

Extending the find-parameter implementation to treat not only
group/topic parameters found in newsrc, but also those found in a
newly introduced regexp->param-list alist, would have the following
advantages:

* Gnus functions could use a single interface to fetch group
parameters based on both methods, without having to deal with regexp
matching and stuff.

* Users would be able to define every group parameter based on regexps
as well, in addition to the group/topic method.

* The latter would allow storing group parameters in a static config
file, suitable for using on several hosts, instead of the
host-dependent, ever-changing newsrc.eld.


While writing this, I have found gnus-define-group-parameter which is
close to what I am talking about.  This defines a function
(gnus-parameter-%s group) for fetching a parameter's value, and this
function makes use of gnus-parameter-%s-alist, which maps group
regexps to parameter values.

However, there are several problems with this:

* For now, only 7 group parameters are defined this way.

* For this reason, the rest of Gnus does not make use of these
functions, but uses gnus-group-find-parameter, which ignores the
contents of gnus-parameter-%s-alist.

* Group/topic parameters allow setting arbitrary variables, not only
`strict' parameters.

* There is still no way to assign multiple parameters to a set of
groups at once.

To demonstrate this: I cannot (but would like to) write the following
in my .gnus:

(setq gnus-parameters
   '(("mail\..*" (gnus-show-threads . nil)
                 (gnus-use-scoring . nil)
                 (gnus-summary-line-format .
                        "%U%R%z%I%(%[%d:%ub%-20,20f%]%) %s\n")
                 (gcc-self . t)
                 (dispaly . all))

     ("list\..*" (total-expire . t)
                 (broken-reply-to . t))))
     

I think the example speaks for itself.  (Setting everything in one
place, independetly of newsrc.eld and topic topology.)

Anyone willing to implement this?  Introducing the new variable (named
gnus-parameters above) and modifying gnus-group-find-parameter would
do the trick, I believe.


Andras



  parent reply	other threads:[~2001-02-23 16:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-22 16:54 Feature request: strip banners from all groups matching a regexp Christopher Splinter
2000-12-22 18:19 ` Jeff Senn
2000-12-22 20:41   ` Christopher Splinter
2000-12-22 18:27 ` Charles Sebold
2000-12-22 20:21   ` Christopher Splinter
2000-12-23 12:38     ` Kai Großjohann
2000-12-23 12:59       ` NAGY Andras
2000-12-23 13:11         ` Kai Großjohann
2001-02-23 16:41         ` NAGY Andras [this message]
2001-02-23 18:57           ` regexp-based group parameters Toby Speight
2001-02-23 20:54           ` Paul Jarc
2001-02-23 21:35             ` Kai Großjohann
2001-02-23 21:57               ` Paul Jarc
2001-02-23 22:29                 ` Kai Großjohann
2001-02-24 15:49               ` Randal L. Schwartz
2001-02-23 22:38             ` ShengHuo ZHU
2001-02-23 22:55               ` Paul Jarc
2001-02-23 23:22                 ` ShengHuo ZHU
2001-02-23 23:56                   ` Paul Jarc
2001-02-24 12:04                 ` Kai Großjohann
2001-02-24 17:34                   ` Paul Jarc
2001-02-24 21:45                     ` Kai Großjohann
2001-02-23 22:35           ` ShengHuo ZHU
2001-02-25  1:55             ` NAGY Andras
2001-02-25 15:07               ` ShengHuo ZHU
2000-12-23  2:08 ` Feature request: strip banners from all groups matching a regexp ShengHuo ZHU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dzc1ysps66o.fsf_-_@pandora.inf.elte.hu \
    --to=nagya@inf.elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).