From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/31456 Path: main.gmane.org!not-for-mail From: Peter Weiss - Sun Germany ENS Engineer Mission Critical - Munich Newsgroups: gmane.emacs.gnus.general Subject: Re: group specific headers headers Date: 19 Jun 2000 15:55:36 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: Reply-To: Peter.Weiss@Class.De NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035167864 14110 80.91.224.250 (21 Oct 2002 02:37:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:37:44 +0000 (UTC) Cc: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann), ding@gnus.org 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 BEA8AD051F for ; Mon, 19 Jun 2000 09:59:57 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.3/8.9.3) with ESMTP id IAC15537; Mon, 19 Jun 2000 08:56:25 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 19 Jun 2000 08:55:38 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id IAA19756 for ; Mon, 19 Jun 2000 08:55:24 -0500 (CDT) Original-Received: from mercury.Sun.COM (mercury.Sun.COM [192.9.25.1]) by mailhost.sclp.com (Postfix) with ESMTP id 4FA7FD051F for ; Mon, 19 Jun 2000 09:55:58 -0400 (EDT) Original-Received: from sun-gy.Germany.Sun.COM ([129.157.168.5]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id GAA13510; Mon, 19 Jun 2000 06:55:39 -0700 (PDT) Original-Received: from winona.Germany.Sun.COM (winona [129.157.167.245]) by sun-gy.Germany.Sun.COM (8.8.8+Sun/8.8.8/ENSMAIL,v1.7) with ESMTP id PAA01792; Mon, 19 Jun 2000 15:55:37 +0200 (MET DST) Original-Received: (from pw105345@localhost) by winona.Germany.Sun.COM (8.9.3+Sun/8.9.1) id PAA23793; Mon, 19 Jun 2000 15:55:37 +0200 (MET DST) X-Authentication-Warning: winona.Germany.Sun.COM: pw105345 set sender to Peter.Weiss@Germany.Sun.com using -f Original-To: Jorge Godoy In-Reply-To: Jorge Godoy's message of "19 Jun 2000 10:19:32 -0300" Original-Lines: 114 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:31456 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:31456 >>>>> On 19 Jun 2000 10:19:32 -0300, Jorge Godoy said: Jorge> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Gro=DFjohann) writes: >> Peter Weiss - Sun Germany ENS Engineer Mission Critical - Munich writes: >>=20 >> > a task that I'd like to do is to set a special header field in a g= roup >> > related way (e.g. when sending from some groups I need a Reply-To-= Field >> > set up, on others not). >>=20 >> Posting styles are your friend. Jorge> Ok... I've looked after them and couldn't find it.=20 Jorge> Could you give me some pointer to the info page? Using Gnus v5.8.7 the info page is the following; File: gnus, Node: Posting Styles, Next: Drafts, Prev: Archived Messages,= Up: Composing Messages Posting Styles =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D All them variables, they make my head swim. So what if you want a different `Organization' and signature based on what groups you post to? And you post both from your home machine and your work machine, and you want different `From' lines, and so on? One way to do stuff like that is to write clever hooks that change the variables you need to have changed. That's a bit boring, so somebody came up with the bright idea of letting the user specify these things in a handy alist. Here's an example of a `gnus-posting-styles' variable: ((".*" (signature "Peace and happiness") (organization "What me?")) ("^comp" (signature "Death to everybody")) ("comp.emacs.i-love-it" (organization "Emacs is it"))) As you might surmise from this example, this alist consists of several "styles". Each style will be applicable if the first element "matches", in some form or other. The entire alist will be iterated over, from the beginning towards the end, and each match will be applied, which means that attributes in later styles that match override the same attributes in earlier matching styles. So `comp.programming.literate' will have the `Death to everybody' signature and the `What me?' `Organization' header. The first element in each style is called the `match'. If it's a string, then Gnus will try to regexp match it against the group name. If it is the symbol `header', then Gnus will look for header that match the next element in the match, and compare that to the last header in the match. If it's a function symbol, that function will be called with no arguments. If it's a variable symbol, then the variable will be referenced. If it's a list, then that list will be `eval'ed. In any case, if this returns a non-`nil' value, then the style is said to "match". Each style may contain a arbitrary amount of "attributes". Each attribute consists of a `(NAME . VALUE)' pair. The attribute name can be one of `signature', `signature-file', `organization', `address', `name' or `body'. The attribute name can also be a string. In that case, this will be used as a header name, and the value will be inserted in the headers of the article; if the value is `nil', the header name will be removed. If the attribute name is `eval', the form is evaluated, and the result is thrown away. The attribute value can be a string (used verbatim), a function with zero arguments (the return value will be used), a variable (its value will be used) or a list (it will be `eval'ed and the return value will be used). The functions and sexps are called/`eval'ed in the message buffer that is being set up. The headers of the current article are available through the `message-reply-headers' variable. If you wish to check whether the message you are about to compose is meant to be a news article or a mail message, you can check the values of the `message-news-p' and `message-mail-p' functions. So here's a new example: (setq gnus-posting-styles '((".*" (signature-file "~/.signature") (name "User Name") ("X-Home-Page" (getenv "WWW_HOME")) (organization "People's Front Against MWM")) ("^rec.humor" (signature my-funny-signature-randomizer)) ((equal (system-name) "gnarly") (signature my-quote-randomizer)) ((message-news-p) (signature my-news-signature)) (header "From.*To" "larsi.*org" (Organization "Somewhere, Inc.")) ((posting-from-work-p) (signature-file "~/.work-signature") (address "user@bar.foo") (body "You are fired.\n\nSincerely, your boss.") (organization "Important Work, Inc")) ("^nn.+:" (signature-file "~/.mail-signature")))) Hth -- Peter --=20 Peter Weiss=20 CLASS Firmengruppe phone +49 (0)8151 / 991 - 512 Moosstrasse 7 fax +49 (0)8151 / 991 - 229 D-82319 Starnberg mobil 0172/ 83 79 125 http://www.class.de mailto:Peter.Weiss@Class.de