From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/27623 Path: main.gmane.org!not-for-mail From: Matt McClure Newsgroups: gmane.emacs.gnus.general Subject: Re: "widening" a reply Date: 03 Dec 1999 12:00:00 -0500 Organization: Gnus Information Center Sender: owner-ding@hpc.uh.edu Message-ID: References: <9t97lix92ob.fsf@mraz.iskon.hr> <9t91z94v40j.fsf@mraz.iskon.hr> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035164616 25503 80.91.224.250 (21 Oct 2002 01:43:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:43:36 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id MAA17049 for ; Fri, 3 Dec 1999 12:01:25 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id LAB08246; Fri, 3 Dec 1999 11:01:03 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 03 Dec 1999 11:00:47 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id LAA28494 for ; Fri, 3 Dec 1999 11:00:34 -0600 (CST) Original-Received: from quimby.gnus.org (quimby.gnus.org [193.69.4.139]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id MAA17044 for ; Fri, 3 Dec 1999 12:00:02 -0500 (EST) Original-Received: (from news@localhost) by quimby.gnus.org (8.9.3/8.9.3) id SAA03107 for ding@gnus.org; Fri, 3 Dec 1999 18:02:10 +0100 (CET) Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 63 Original-NNTP-Posting-Host: users.ccur.com Original-X-Trace: quimby.gnus.org 944240529 7787 208.248.32.211 (3 Dec 1999 17:02:09 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 3 Dec 1999 17:02:09 GMT User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.4 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:27623 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:27623 On Fri Dec 03 1999, 03:10, Hrvoje Niksic 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/