[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to create/add-to-existing headers in a posting style?
From: |
Adam Sjøgren |
Subject: |
Re: How to create/add-to-existing headers in a posting style? |
Date: |
Mon, 16 Jul 2012 11:22:15 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) |
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
(=
(-
(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ært, hop op Adam Sjøgren
og ned og hav det rigtigt af helvede til." asjo@koldfront.dk
- How to create/add-to-existing headers in a posting style?, Adam Sjøgren, 2012/07/14
- Re: How to create/add-to-existing headers in a posting style?, Tassilo Horn, 2012/07/15
- Re: How to create/add-to-existing headers in a posting style?, Adam Sjøgren, 2012/07/15
- Re: How to create/add-to-existing headers in a posting style?, Tassilo Horn, 2012/07/17
- Re: How to create/add-to-existing headers in a posting style?, Tassilo Horn, 2012/07/17
- Re: How to create/add-to-existing headers in a posting style?, Adam Sjøgren, 2012/07/17
- Re: How to create/add-to-existing headers in a posting style?, Tassilo Horn, 2012/07/18
- Re: How to create/add-to-existing headers in a posting style?, Adam Sjøgren, 2012/07/18
- Re: How to create/add-to-existing headers in a posting style?, Tassilo Horn, 2012/07/19
- Re: How to create/add-to-existing headers in a posting style?, Adam Sjøgren, 2012/07/19