From bd0327222d624685cb542b7561ec5845ab31431b Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 26 Nov 1998 08:17:46 +0000 Subject: [PATCH] Support for superseding news article with MIME-Edit. --- lisp/gnus-msg.el | 3 ++- lisp/message.el | 27 ++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 84de9cb..2332c5e 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -360,7 +360,8 @@ post using the current select method." This is done simply by taking the old article and adding a Supersedes header line with the old Message-ID." (interactive) - (let ((article (gnus-summary-article-number))) + (let ((article (gnus-summary-article-number)) + (gnus-message-setup-hook '(gnus-maybe-setup-default-charset))) (gnus-setup-message 'reply-yank (gnus-summary-select-article t) (set-buffer gnus-original-article-buffer) diff --git a/lisp/message.el b/lisp/message.el index 6b2bb9f..ee36b7f 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -252,6 +252,12 @@ any confusion." :group 'message-interface :type 'regexp) +(defcustom message-supersede-setup-function + 'message-supersede-setup-for-mime-edit + "Function to setup a supersede message." + :group 'message-sending + :type 'function) + (defcustom message-subject-re-regexp "^[ \t]*\\([Rr][Ee]:[ \t]*\\)*[ \t]*" "*Regexp matching \"Re: \" in the subject line." :group 'message-various @@ -576,11 +582,17 @@ the signature is inserted." :type 'hook) (defcustom message-bounce-setup-hook nil - "Normal hook, run each time a a re-sending bounced message is initialized. + "Normal hook, run each time a re-sending bounced message is initialized. The function `message-bounce' runs this hook." :group 'message-various :type 'hook) +(defcustom message-supersede-setup-hook nil + "Normal hook, run each time a supersede message is initialized. +The function `message-supersede' runs this hook." + :group 'message-various + :type 'hook) + (defcustom message-mode-hook nil "Hook run in message mode buffers." :group 'message-various @@ -4199,6 +4211,10 @@ that further discussion should take place only in " (message "Canceling your article...done")) (kill-buffer buf))))) +(defun message-supersede-setup-for-mime-edit () + (set (make-local-variable 'message-setup-hook) nil) + (mime-edit-again)) + ;;;###autoload (defun message-supersede () "Start composing a message to supersede the current message. @@ -4232,7 +4248,11 @@ header line with the old Message-ID." (goto-char (point-max)) (insert mail-header-separator) (widen) - (forward-line 1))) + (when message-supersede-setup-function + (funcall message-supersede-setup-function)) + (run-hooks 'message-supersede-setup-hook) + (goto-char (point-min)) + (search-forward (concat "\n" mail-header-separator "\n") nil t))) ;;;###autoload (defun message-recover () @@ -4419,9 +4439,6 @@ Optional NEWS will use news to forward instead of mail." (message "Resending message to %s...done" address))) (defun message-bounce-setup-for-mime-edit () - (goto-char (point-min)) - (when (search-forward (concat "\n" mail-header-separator "\n") nil t) - (replace-match "\n\n")) (set (make-local-variable 'message-setup-hook) nil) (mime-edit-again)) -- 1.7.10.4