From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/15616 Path: news.gmane.org!not-for-mail From: asjo@koldfront.dk (Adam =?iso-8859-1?Q?Sj=F8gren?=) Newsgroups: gmane.emacs.gnus.user Subject: Re: How to create/add-to-existing headers in a posting style? Date: Mon, 16 Jul 2012 11:22:15 +0200 Organization: koldfront - analysis & revolution, Copenhagen, Denmark Message-ID: <87hat8cb7c.fsf@topper.koldfront.dk> References: <87394utbvr.fsf@topper.koldfront.dk> <87mx31xukz.fsf@thinkpad.tsdh.de> <87wr25qfth.fsf@topper.koldfront.dk> <87vchoke2r.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1342430567 6673 80.91.229.3 (16 Jul 2012 09:22:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 09:22:47 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Mon Jul 16 11:22:46 2012 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SqhVr-0007wJ-Hm for gegu-info-gnus-english@m.gmane.org; Mon, 16 Jul 2012 11:22:43 +0200 Original-Received: from localhost ([::1]:42392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqhVq-0001Av-NT for gegu-info-gnus-english@m.gmane.org; Mon, 16 Jul 2012 05:22:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqhVl-0001Ao-Ci for info-gnus-english@gnu.org; Mon, 16 Jul 2012 05:22:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SqhVc-0007cr-HD for info-gnus-english@gnu.org; Mon, 16 Jul 2012 05:22:37 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SqhVc-0007cn-9z for info-gnus-english@gnu.org; Mon, 16 Jul 2012 05:22:28 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SqhVa-0007dt-HC for info-gnus-english@gnu.org; Mon, 16 Jul 2012 11:22:26 +0200 Original-Received: from 2505ds5-by.0.fullrate.dk ([89.150.142.116]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jul 2012 11:22:26 +0200 Original-Received: from asjo by 2505ds5-by.0.fullrate.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 Jul 2012 11:22:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 50 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 2505ds5-by.0.fullrate.dk X-Face: )qY&CseJ?.:=8F#^~GcSA?F=9eu'{KAFfL1C3/A&:nE?PW\i65"ba0NS)97, Q(^@xk}n4Ou rPuR#V8I(J_@~H($[ym:`K_+]*kjvW>xH5jbgLBVFGXY:(#4P>zVBklLbdL&XxL\M)%T}3S/IS9lMJ ^St'=VZBR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:15616 Archived-At: On Sun, 15 Jul 2012 21:40:44 +0200, Tassilo wrote: > Another approach was to use gnus-parameters to add your > append-hugo-in-cc function to message-header-hook (or > message-header-setup-hook?) locally for this group. How do I add it locally? Ah, add-hook has a LOCAL parameter. Hm. Let's see if I can figure this out... Ok, this is what I have cobbled together in the group parameters of the group in question: ((x-add-to-cc (lambda nil (add-hook 'message-setup-hook (lambda nil (save-excursion (message-goto-cc) (when (not (string-match "gottahavethisincc@example.org" (buffer-substring-no-properties (line-beginning-position) (line-end-position)))) (when (not (=3D (- (point) (line-beginning-position)) 4)) (insert ", ")) (insert "gottahavethisincc@example.org")))) nil t) ""))))) Which kind of works; the only problem with this is, that it leaves an empty header "X-Add-To-Cc" in the buffer, which is ugly - but I couldn't figure out how to have my function run without adding a header... Any ideas to clean this up will be much appreciated. Best regards, Adam -- = "Godnat og sov rigtigt godt eller, subsidi=E6rt, hop op Adam Sj=F8g= ren og ned og hav det rigtigt af helvede til." asjo@koldfront.dk