Gnus development mailing list
 help / color / mirror / Atom feed
From: Matt McClure <matthew.mcclure.es.99@aya.yale.edu>
Subject: Re: "widening" a reply
Date: 03 Dec 1999 12:00:00 -0500	[thread overview]
Message-ID: <vl3yabc6ju7.fsf@amber2.ccur.com> (raw)
In-Reply-To: <9t91z94v40j.fsf@mraz.iskon.hr>

On Fri Dec 03 1999, 03:10, Hrvoje Niksic <hniksic@iskon.hr> wrote:

> > A sort of `message-insert-wide-to'?  Sure; sounds good to me.
> 
> Will you be adding it?  I have no idea where to start.

Here's a quick and dirty version that widens the reply.  I patched
together code from message-reply and from message-insert-to.  It could
probably be a lot cleaner, but at least it works (or seems to so far
anyway).

   (defun message-insert-wide-to ()
     "Insert a Cc header which includes all recipients of the original article."
     (interactive)
     (let (to cc follow-to)
       (if (message-functionp message-wide-reply-to-function)
           (setq follow-to
                 (funcall message-wide-reply-to-function)))

       (setq to (message-fetch-reply-field "to")
             cc (message-fetch-reply-field "cc"))

       (unless follow-to
         (let (ccalist)
           (save-excursion
             (message-set-work-buffer)
             (insert (if to (concat (if (bolp) "" ", ") to "") ""))
             (insert (if cc (concat (if (bolp) "" ", ") cc) ""))
             (goto-char (point-min))
             (while (re-search-forward "[ \t]+" nil t)
               (replace-match " " t t))
             ;; Remove addresses that match `rmail-dont-reply-to-names'.
             (let ((rmail-dont-reply-to-names message-dont-reply-to-names))
               (insert (prog1 (rmail-dont-reply-to (buffer-string))
                         (erase-buffer))))
             (goto-char (point-min))
             (setq ccalist
                   (mapcar
                    (lambda (addr)
                      (cons (mail-strip-quoted-names addr) addr))
                    (message-tokenize-header (buffer-string))))
             (let ((s ccalist))
               (while s
                 (setq ccalist (delq (assoc (car (pop s)) s) ccalist)))))
           (setq follow-to nil)
           (when ccalist
             (let ((ccs (cons 'Cc (mapconcat
                                   (lambda (addr) (cdr addr)) ccalist ", "))))
               (when (string-match "^ +" (cdr ccs))
                 (setcdr ccs (substring (cdr ccs) (match-end 0))))
               (push ccs follow-to)))))

       (setq follow-to (cdar follow-to))

       (when (and (message-goto-cc)
                  follow-to
                  (not (string-match "\\` *\\'" follow-to)))
         (insert ", "))
       (insert follow-to)))

-- 
Matt
http://www.faradic.net/~mmcclure/


  reply	other threads:[~1999-12-03 17:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-01 15:06 Matt McClure
1999-12-01 22:39 ` Lars Magne Ingebrigtsen
1999-12-02  8:17   ` Hrvoje Niksic
1999-12-02 23:11     ` Lars Magne Ingebrigtsen
1999-12-03  8:10       ` Hrvoje Niksic
1999-12-03 17:00         ` Matt McClure [this message]
1999-12-03 17:14           ` Hrvoje Niksic
1999-12-03 18:30             ` Matt McClure
1999-12-04 17:00               ` Hrvoje Niksic
1999-12-06 19:20                 ` Matt McClure
2000-04-21 23:32         ` Lars Magne Ingebrigtsen
2000-04-21 23:33         ` Lars Magne Ingebrigtsen
1999-12-05 22:08   ` Kai Großjohann

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=vl3yabc6ju7.fsf@amber2.ccur.com \
    --to=matthew.mcclure.es.99@aya.yale.edu \
    /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).