From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/44342 Path: main.gmane.org!not-for-mail From: Matthieu Moy Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Removing headers from message when resending. Date: Tue, 23 Apr 2002 09:45:47 +0200 Organization: Verimag Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019548084 3815 127.0.0.1 (23 Apr 2002 07:48:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2002 07:48:04 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16zv1v-0000zJ-00 for ; Tue, 23 Apr 2002 09:48:03 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16zv0N-0004Wt-00; Tue, 23 Apr 2002 02:46:27 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 23 Apr 2002 02:46:38 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id CAA20952 for ; Tue, 23 Apr 2002 02:46:26 -0500 (CDT) Original-Received: (qmail 7761 invoked by alias); 23 Apr 2002 07:46:05 -0000 Original-Received: (qmail 7756 invoked from network); 23 Apr 2002 07:46:04 -0000 Original-Received: from imag.imag.fr (129.88.30.1) by gnus.org with SMTP; 23 Apr 2002 07:46:04 -0000 Original-Received: from montrose.imag.fr (root@montrose.imag.fr [129.88.43.123]) by imag.imag.fr (8.11.6/8.11.6) with ESMTP id g3N7k2w06153 for ; Tue, 23 Apr 2002 09:46:02 +0200 (MEST) Original-Received: (from moy@localhost) by montrose.imag.fr (8.9.3/8.9+/ImagV2.feuille) id JAA20497; Tue, 23 Apr 2002 09:45:47 +0200 X-Authentication-Warning: montrose.imag.fr: moy set sender to Matthieu.Moy@imag.fr using -f Original-To: ding@gnus.org X-Face: %xEb27l:C~bcH,tGGRk8m'o_}XBMb*NoIbS$sp(:3s+l@PwMH+C*7Vf@Y_]%rP)*/'`Lpt[O9C;jbVo?Qp X-Url: http://www-verimag.imag.fr/~moy/ Mail-Copies-To: never Mail-Followup-To: ding@gnus.org Original-Lines: 46 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:44342 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:44342 Hi ! I have made a slight modification to gnus-summary-resend-message-edit, which I had written some time ago. It now removes headers like forwarding does. Can someone apply it ? -- Matthieu (defcustom message-resend-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus\\|^Received:\\|^X-" "*All headers that match this regexp will be deleted when forwarding a message." :version "21.1" :group 'message-forwarding :type '(choice (const :tag "None" nil) regexp)) ;;;###autoload (defun gnus-summary-resend-article-edit () "In gnus summary mode, resend an article that has already been sent. A new buffer will be created to allow the user to modify body and contents of the message, and then, everything will happen as when composing a new message." (interactive) (let ((article (gnus-summary-article-number))) (gnus-setup-message 'reply-yank (gnus-summary-select-article t) (set-buffer gnus-original-article-buffer) (let ((cur (current-buffer)) (to (message-fetch-field "to"))) ;; Get a normal message buffer. (message-pop-to-buffer (message-buffer-name "Resend" to)) (insert-buffer-substring cur) (mime-to-mml) (message-narrow-to-head-1) ;; Gnus will generate a new one when sending. (message-remove-header "Message-ID") (message-remove-header message-resend-ignored-headers t) ;; Remove unwanted headers. (goto-char (point-max)) (insert mail-header-separator) (goto-char (point-min)) (re-search-forward "^To: *\\|^Newsgroups: *" nil 'move) (widen) ) )))