Gnus development mailing list
 help / color / mirror / Atom feed
* [CODE] Editing and resending an existing mail.
@ 2002-01-31 13:39 Matthieu Moy
  2002-01-31 14:12 ` ShengHuo ZHU
  0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Moy @ 2002-01-31 13:39 UTC (permalink / raw)


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 <Matthieu.Moy@imag.fr>
;; 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-01-31 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-31 13:39 [CODE] Editing and resending an existing mail Matthieu Moy
2002-01-31 14:12 ` ShengHuo ZHU
2002-01-31 14:46   ` Matthieu Moy

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).