From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/42826 Path: main.gmane.org!not-for-mail From: Matthieu Moy Newsgroups: gmane.emacs.gnus.general Subject: [CODE] Editing and resending an existing mail. Date: Thu, 31 Jan 2002 14:39:56 +0100 Organization: Verimag Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035178017 14254 80.91.224.250 (21 Oct 2002 05:26:57 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:26:57 +0000 (UTC) Return-Path: Original-Received: (qmail 25224 invoked from network); 31 Jan 2002 13:41:29 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 31 Jan 2002 13:41:29 -0000 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 16WHSf-00053n-00; Thu, 31 Jan 2002 07:41:09 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 31 Jan 2002 07:40:55 -0600 (CST) 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 HAA29715 for ; Thu, 31 Jan 2002 07:40:00 -0600 (CST) Original-Received: (qmail 25180 invoked by alias); 31 Jan 2002 13:39:58 -0000 Original-Received: (qmail 25175 invoked from network); 31 Jan 2002 13:39:58 -0000 Original-Received: from ingebrigtsen.no (HELO quimby2.netfonds.no) (195.204.10.66) by gnus.org with SMTP; 31 Jan 2002 13:39:58 -0000 Original-Received: from news by quimby2.netfonds.no with local (Exim 3.12 #1 (Debian)) id 16WHWD-0005L2-00 for ; Thu, 31 Jan 2002 14:44:49 +0100 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 93 Original-NNTP-Posting-Host: ubaye.imag.fr Original-X-Trace: quimby2.netfonds.no 1012484689 20116 129.88.43.88 (31 Jan 2002 13:44:49 GMT) Original-X-Complaints-To: usenet@quimby2.netfonds.no Original-NNTP-Posting-Date: 31 Jan 2002 13:44:49 GMT X-Home-Page: http://www-ensimag.imag.fr/eleves/Matthieu.Moy/ X-Url: http://www-ensimag.imag.fr/eleves/Matthieu.Moy/ X-Face: %xEb27l:C~bcH,tGGRk8m'o_}XBMb*NoIbS$sp(:3s+l@PwMH+C*7Vf@Y_]%rP)*/'`Lpt[O9C;jbVo?Qp User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i686-pc-linux-gnu) Cancel-Lock: sha1:aM2VjviMMJ4hrqAmEORzgjQNXjA= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:42826 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:42826 Hello. Some time ago, I had written a mail, and wanted to send it to someone else. There is the function Resend Message, but it does not allow edition of the article, and I also wanted to change something inside the message. I knew it in mutt (M-e), but did not find it in Gnus. So, I wrote a little function to do that. Here it is. On fr.comp.applications.emacs, some other people were interested in it, so, I wonder if this could be integrated in gnus itself. (isn't mutt supposed to be included in Gnus ;-) It is also availlable from http://www-verimag.imag.fr/~moy/emacs/moy-gnus.el -- Matthieu ;;; moy-gnus.el --- My gnus stuff. ;; Copyright (C) 2002 Free Software Foundation, Inc. ;; Author: Matthieu Moy ;; Keywords: mail ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Usage : in .gnus ;; ;; | (require 'moy-gnus) ;; | (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map) ;; | "e" moy-gnus-summary-resend-article ; This could also be added in ;; | ; gnus-msg.el line 262. ;; | ) ;; ;; Then S D e in summary buffer will re-open the current article in a ;; new mail edition buffer. The user will be able to edit the article ;; and header, and resend it as a new mail. ;;; Code: (defun moy-gnus-summary-resend-article () "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) (message-remove-header "Message-ID") (goto-char (point-max)) ;(forward-char -1) (insert "Message-ID: " (message-make-message-id) "\n") ;; Remove unwanted headers. (goto-char (point-max)) (insert mail-header-separator) (goto-char (point-min)) (re-search-forward "^To:\\|^Newsgroups:") (forward-char 1) (widen) ) ))) (provide 'moy-gnus) ;;; moy-gnus.el ends here