From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/34923 Path: main.gmane.org!not-for-mail From: NAGY Andras Newsgroups: gmane.emacs.gnus.general Subject: regexp-based group parameters Date: 23 Feb 2001 17:41:19 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: <873dfg9z1x.fsf@splinter.inka.de> <87wvcs8awc.fsf@splinter.inka.de> <878zp71ef0.fsf@lovi.inf.elte.hu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035170755 327 80.91.224.250 (21 Oct 2002 03:25:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:25:55 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by mailhost.sclp.com (Postfix) with ESMTP id 7633AD049F for ; Fri, 23 Feb 2001 11:42:04 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.3/8.9.3) with ESMTP id KAC27180; Fri, 23 Feb 2001 10:41:42 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 23 Feb 2001 10:41:02 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id KAA11127 for ; Fri, 23 Feb 2001 10:40:52 -0600 (CST) Original-Received: from mail.inf.elte.hu (mail.inf.elte.hu [157.181.161.6]) by mailhost.sclp.com (Postfix) with ESMTP id 4F3F1D049F for ; Fri, 23 Feb 2001 11:41:22 -0500 (EST) Original-Received: by mail.inf.elte.hu (Postfix, from userid 28535) id D821B8143; Fri, 23 Feb 2001 17:41:19 +0100 (CET) Original-To: ding@gnus.org In-Reply-To: <878zp71ef0.fsf@lovi.inf.elte.hu> (NAGY Andras's message of "23 Dec 2000 13:59:47 +0100") User-Agent: Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.1 (Biscayne) Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 93 Xref: main.gmane.org gmane.emacs.gnus.general:34923 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:34923 NAGY Andras 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