Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Re: Always copying a mailing list
Date: Wed, 04 Aug 2004 10:15:12 +0200	[thread overview]
Message-ID: <v9zn5b5nfz.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <86n01diut3.fsf@ketchup.de.uu.net>

On Mon, Aug 02 2004, Kai Grossjohann wrote:

> I can set mail-self-blind to get "Bcc: kais.address" in outgoing
> messages.  But I have a special group where I'd rather like to have
> "Cc: some.mailinglist".
>
> I've tried to frob the posting style for the group, saying (("Gcc" .
> nil) ("Cc" . "some.mailinglist")).  But this does not work as I like,
> because it also removes other recipients that I would like to keep.
>
> The behavior I'm looking for is: After I've hit R or F (or S W or S
> V), add the following address to the list of recipients if not yet
> present.
>
> How to do that?

(defun rs-message-replace-header (header new-value)
  "Remove HEADER and insert the NEW-VALUE."
  ;; Similar to `nnheader-replace-header' but for message buffers.
  (save-excursion
    (save-restriction
      (message-narrow-to-headers)
      (message-remove-header header))
    (message-position-on-field header)
    (insert new-value)))

(defun kai-message-add-cc (cc)
  "Insert an additional address in Cc field."
  (interactive "MAddress: \n")
  (save-excursion
    (let ((occ (message-fetch-field "Cc")))
      (rs-message-replace-header
       "Cc" (concat occ (when (and occ cc) ", ") cc)))))

Wrapping this function in a suitable message hook and taking the
address from posting styles is left as an exercise to the reader.
(You may also find `message-carefully-insert-headers' and
`message-header-synonyms' useful.)

BTW, I wonder if there is no builtin function for...

,----
| (defun rs-message-replace-header (header new-value)
|   "Remove HEADER and insert the NEW-VALUE."
|   ;; Similar to `nnheader-replace-header' but for message buffers.
`----

Should we add this as `message-replace-header' in `message.el'?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




      parent reply	other threads:[~2004-08-04  8:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-02 12:33 Kai Grossjohann
2004-08-02 13:29 ` David S Goldberg
2004-08-04  8:15 ` Reiner Steib [this message]

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=v9zn5b5nfz.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=reiner.steib@gmx.de \
    /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).