From: yamaoka Date: Thu, 26 Nov 1998 08:15:39 +0000 (+0000) Subject: Support for superseding news article with MIME-Edit. X-Git-Tag: gnus-6_8-199811302358~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a35a858b1d4e902a375a5c454158e3c58dfb392;p=elisp%2Fgnus.git- Support for superseding news article with MIME-Edit. --- diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 5ef7209..116ad34 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -351,7 +351,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-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 10c0a4d..1aac786 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -243,6 +243,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 @@ -494,6 +500,12 @@ 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 @@ -3933,6 +3945,10 @@ responses here are directed to other newsgroups.")) (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. @@ -3966,7 +3982,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 () @@ -4151,9 +4171,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))