Gnus development mailing list
 help / color / mirror / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: ding@gnus.org
Subject: Re: how can I convert the To field to CC
Date: Sat, 20 Feb 2021 23:26:02 +0100	[thread overview]
Message-ID: <87ft1qe5qd.fsf@mat.ucm.es> (raw)
In-Reply-To: <87k0r27eao.fsf@zoho.eu>

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]


> Uwe Brauer wrote:

> You are right, I only tested for headers with a value, but now
> it works:

> (defun message-set-header (hdr val)
>   (interactive "sheader: \nsvalue: ")
>   (message-position-on-field hdr)
>   (message-beginning-of-header nil)
>   (delete-region (point) (point-at-eol))
>   (insert val) )
> ;; test:
> ;; (message-set-header "Subject" "Lara loves YOU")

> (defun message-transpose-headers (hdr1 hdr2)
>   (interactive "sheader 1: \nsheader 2: ")
>   (save-excursion
>     (let ((v1 (or (message-field-value hdr1) ""))
>           (v2 (or (message-field-value hdr2) "")) )
>       (message-set-header hdr1 v2)
>       (message-set-header hdr2 v1) )))
> ;; test:
> ;; (message-transpose-headers "To" "Subject")


For single lines addresses yes, 


To: user1@gmail.com
Cc: user2@gmail.com

Changes to 

To: user2@gmail.com
Cc: user1@gmail.com


But if you have multi line addresses, which can happen if you use bbdb
then

To: user1@gmail.com, user3@gmail.com,
    user4@gmail.com
Cc: user2@gmail.com

gives

To: user1@gmail.com, user3@gmail.com,
    user2@gmail.com
Cc: user1@gmail.com, user3@gmail.com, user4@gmail.com



[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

  reply	other threads:[~2021-02-20 22:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 20:57 Uwe Brauer
2021-02-19 21:09 ` Emanuel Berg
2021-02-20  1:10 ` Emanuel Berg
2021-02-20 10:16   ` Uwe Brauer
2021-02-20 19:03     ` Emanuel Berg
2021-02-20 22:27       ` Uwe Brauer
2021-02-20 22:39         ` Emanuel Berg
2021-02-20 10:21   ` Uwe Brauer
2021-02-20 19:02     ` Emanuel Berg
2021-02-20 22:26       ` Uwe Brauer [this message]
2021-02-20 22:31         ` Uwe Brauer
2021-02-20 23:10         ` dick.r.chiang
2021-02-21  0:24           ` Emanuel Berg
2021-02-21  0:36             ` Emanuel Berg
2021-02-21  3:03               ` dick.r.chiang
2021-02-21  3:18                 ` Emanuel Berg
2021-02-21  4:13                   ` dick.r.chiang
2021-02-21  2:55             ` dick.r.chiang
2021-02-21  3:24               ` Emanuel Berg
2021-02-21  4:09                 ` dick.r.chiang
2021-02-21  4:47                   ` Emanuel Berg
2021-02-21  9:18                     ` Uwe Brauer
2021-02-21  9:36                       ` Emanuel Berg
2021-03-01  7:40                         ` Uwe Brauer
2021-03-02  2:57                           ` Emanuel Berg
2021-03-02  3:38                           ` Emanuel Berg
2021-03-01  7:44                         ` Uwe Brauer
2021-03-02  2:55                           ` Emanuel Berg
2021-05-09  4:45                     ` Emanuel Berg

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=87ft1qe5qd.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=ding@gnus.org \
    /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).