1 ;;; gnus-mh.el --- mh-e interface for Gnus
2 ;; Copyright (C) 1994,95 Free Software Foundation, Inc.
4 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
5 ;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26 ;;; Send mail using mh-e.
28 ;; The following mh-e interface is all cooperative works of
29 ;; tanaka@flab.fujitsu.CO.JP (TANAKA Hiroshi), kawabe@sra.CO.JP
30 ;; (Yoshikatsu Kawabe), and shingu@casund.cpr.canon.co.jp (Toshiaki
40 (defun gnus-summary-save-article-folder (&optional arg)
41 "Append the current article to an mh folder.
42 If N is a positive number, save the N next articles.
43 If N is a negative number, save the N previous articles.
44 If N is nil and any articles have been marked with the process mark,
45 save those articles instead."
47 (let ((gnus-default-article-saver 'gnus-summary-save-in-folder))
48 (gnus-summary-save-article arg)))
50 (defun gnus-summary-save-in-folder (&optional folder)
51 "Save this article to MH folder (using `rcvstore' in MH library).
52 Optional argument FOLDER specifies folder name."
53 ;; Thanks to yuki@flab.Fujitsu.JUNET and ohm@kaba.junet.
59 (funcall gnus-folder-save-name gnus-newsgroup-name
60 gnus-current-headers gnus-newsgroup-last-folder)
62 (errbuf (get-buffer-create " *Gnus rcvstore*")))
63 (gnus-eval-in-buffer-window
68 (call-process-region (point-min) (point-max)
69 (expand-file-name "rcvstore" mh-lib)
70 nil errbuf nil folder)
72 (if (zerop (buffer-size))
73 (message "Article saved in folder: %s" folder)
74 (message "%s" (buffer-string)))
75 (kill-buffer errbuf))))
76 (setq gnus-newsgroup-last-folder folder)))
78 (defun gnus-mh-mail-setup (to subject in-reply-to cc replybuffer actions)
79 (let ((config (current-window-configuration)))
80 (setq mh-show-buffer gnus-article-copy)
82 (mh-send-sub (or to "") (or cc "") (or subject "(None)") config)
83 (goto-char (point-min))
84 (insert "In-Reply-To: " in-reply-to "\n")
85 (setq mh-sent-from-folder gnus-article-copy)
86 (setq mh-sent-from-msg 1)
87 (setq mh-previous-window-config config)))
89 (defun gnus-Folder-save-name (newsgroup headers &optional last-folder)
90 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
91 If variable `gnus-use-long-file-name' is nil, it is +News.group.
92 Otherwise, it is like +news/group."
95 (if gnus-use-long-file-name
96 (gnus-capitalize-newsgroup newsgroup)
97 (gnus-newsgroup-directory-form newsgroup)))))
99 (defun gnus-folder-save-name (newsgroup headers &optional last-folder)
100 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
101 If variable `gnus-use-long-file-name' is nil, it is +news.group.
102 Otherwise, it is like +news/group."
105 (if gnus-use-long-file-name
107 (gnus-newsgroup-directory-form newsgroup)))))
109 ;;; gnus-mh.el ends here