- (setq mh-show-buffer buffer)
- (setq mh-previous-window-config config)
- )
-
- ;; Then, yank original article if requested.
- (if yank
- (let ((last (point)))
- (mh-yank-cur-msg)
- (goto-char last)
- )))
-
-;; gnus-mail-forward-using-mhe is contributed by Jun-ichiro Itoh
-;; <itojun@ingram.mt.cs.keio.ac.jp>
-
-(defun gnus-mail-forward-using-mhe (&optional buffer)
- "Forward the current message to another user using mh-e."
- ;; First of all, prepare mhe mail buffer.
- (let* ((to (read-string "To: "))
- (cc (read-string "Cc: "))
- (buffer (or buffer gnus-article-buffer))
- (config (current-window-configuration)) ;; need to add this - erik
- (subject (gnus-forward-make-subject buffer)))
- (setq mh-show-buffer buffer)
- (mh-find-path)
- (mh-send-sub to (or cc "") (or subject "(None)") config) ;; Erik Selberg 1/23/94
- (let ((draft (current-buffer))
- mail-buf)
- (gnus-configure-windows 'reply-yank)
- (setq mail-buf (cdr (assq 'mail gnus-window-to-buffer)))
- (pop-to-buffer mail-buf) ;; always in the display, so won't have window probs
- (switch-to-buffer draft)
- (kill-buffer mail-buf) ;; mh-e don't use it!
- )
- (save-excursion
- (goto-char (point-max))
- (insert "\n------- Forwarded Message\n\n")
- (insert-buffer buffer)
- (goto-char (point-max))
- (insert "\n------- End of Forwarded Message\n")
- (setq mh-sent-from-folder buffer)
- (setq mh-sent-from-msg 1)
- (setq mh-previous-window-config config)
- )))
-
-(defun gnus-mail-other-window-using-mhe ()
- "Compose mail other window using mh-e."
- (let ((to (read-string "To: "))
- (cc (read-string "Cc: "))
- (subject (read-string "Subject: ")))
- (gnus-article-show-all-headers) ;I don't think this is really needed.
- (setq mh-show-buffer (current-buffer))
- (mh-find-path)
- (mh-send-other-window to cc subject)
- (setq mh-sent-from-folder (current-buffer))
- (setq mh-sent-from-msg 1)))
+ (setq gnus-mail-buffer (buffer-name (current-buffer)))
+ (use-local-map (copy-keymap (current-local-map)))
+ (local-set-key "\C-c\C-c" 'gnus-mh-mail-send-and-exit)
+ (setq mh-show-buffer gnus-article-copy)
+ (setq mh-previous-window-config config)))
+
+(defun gnus-mh-mail-send-and-exit (&optional dont-send)
+ "Send the current mail and return to Gnus."
+ (interactive)
+ (let* ((reply gnus-article-reply)
+ (winconf gnus-prev-winconf)
+ (address-group gnus-add-to-address)
+ (to-address (and address-group
+ (mail-fetch-field "to"))))
+ (setq gnus-add-to-address nil)
+ (or dont-send (mh-send-letter))
+ (bury-buffer)
+ ;; This mail group doesn't have a `to-address', so we add one
+ ;; here. Magic!
+ (and to-address
+ (gnus-group-add-parameter
+ address-group (cons 'to-address to-address)))
+ (if (get-buffer gnus-group-buffer)
+ (progn
+ (if (gnus-buffer-exists-p (car-safe reply))
+ (progn
+ (set-buffer (car reply))
+ (and (cdr reply)
+ (gnus-summary-mark-article-as-replied
+ (cdr reply)))))
+ (and winconf (set-window-configuration winconf))))))