Mercurial > emacs
annotate lisp/=gnusmail.el @ 731:5c6db33a9ef6
Initial revision
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Tue, 30 Jun 1992 13:49:39 +0000 |
parents | 22b98190b7ef |
children | 4f28bd14272c |
rev | line source |
---|---|
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
1 ;;; gnusmail.el --- mail reply commands for GNUS newsreader |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
2 |
711
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
710
diff
changeset
|
3 ;; Copyright (C) 1990 Free Software Foundation, Inc. |
205 | 4 ;; $Header: gnusmail.el,v 1.1 90/03/23 13:24:39 umerin Locked $ |
5 | |
6 ;; This file is part of GNU Emacs. | |
7 | |
710
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
8 ;; GNU Emacs is free software; you can redistribute it and/or modify |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
9 ;; it under the terms of the GNU General Public License as published by |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
10 ;; the Free Software Foundation; either version 1, or (at your option) |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
11 ;; any later version. |
205 | 12 |
710
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
13 ;; GNU Emacs is distributed in the hope that it will be useful, |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
16 ;; GNU General Public License for more details. |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
17 |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
18 ;; You should have received a copy of the GNU General Public License |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
19 ;; along with GNU Emacs; see the file COPYING. If not, write to |
d18c8feb66bd
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
20 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
205 | 21 |
22 (require 'gnus) | |
23 | |
24 ;; Provides mail reply and mail other window command using usual mail | |
25 ;; interface and mh-e interface. | |
26 ;; | |
27 ;; To use MAIL: set the variables gnus-mail-reply-method and | |
28 ;; gnus-mail-other-window-method to gnus-mail-reply-using-mail and | |
29 ;; gnus-mail-other-window-using-mail, respectively. | |
30 ;; | |
31 ;; To use MH-E: set the variables gnus-mail-reply-method and | |
32 ;; gnus-mail-other-window-method to gnus-mail-reply-using-mhe and | |
33 ;; gnus-mail-other-window-using-mhe, respectively. | |
34 | |
35 (autoload 'news-mail-reply "rnewspost") | |
36 (autoload 'news-mail-other-window "rnewspost") | |
37 | |
38 (autoload 'mh-send "mh-e") | |
39 (autoload 'mh-send-other-window "mh-e") | |
40 (autoload 'mh-find-path "mh-e") | |
41 (autoload 'mh-yank-cur-msg "mh-e") | |
42 | |
43 ;;; Mail reply commands of GNUS Subject Mode | |
44 | |
45 (defun gnus-Subject-mail-reply (yank) | |
46 "Reply mail to news author. | |
47 If prefix arg YANK is non-nil, original article is yanked automatically. | |
48 Customize the variable `gnus-mail-reply-method' to use another mailer." | |
49 (interactive "P") | |
50 (gnus-Subject-select-article) | |
51 (switch-to-buffer gnus-Article-buffer) | |
52 (widen) | |
53 (delete-other-windows) | |
54 (bury-buffer gnus-Article-buffer) | |
55 (funcall gnus-mail-reply-method yank)) | |
56 | |
57 (defun gnus-Subject-mail-reply-with-original () | |
58 "Reply mail to news author with original article." | |
59 (interactive) | |
60 (gnus-Subject-mail-reply t)) | |
61 | |
62 (defun gnus-Subject-mail-other-window () | |
63 "Compose mail in other window. | |
64 Customize the variable `gnus-mail-other-window-method' to use another mailer." | |
65 (interactive) | |
66 (gnus-Subject-select-article) | |
67 (switch-to-buffer gnus-Article-buffer) | |
68 (widen) | |
69 (delete-other-windows) | |
70 (bury-buffer gnus-Article-buffer) | |
71 (funcall gnus-mail-other-window-method)) | |
72 | |
73 | |
74 ;;; Send mail using sendmail mail mode. | |
75 | |
76 (defun gnus-mail-reply-using-mail (&optional yank) | |
77 "Compose reply mail using mail. | |
78 Optional argument YANK means yank original article." | |
79 (news-mail-reply) | |
80 (gnus-overload-functions) | |
81 (if yank | |
82 (let ((last (point))) | |
83 (goto-char (point-max)) | |
84 (mail-yank-original nil) | |
85 (goto-char last) | |
86 ))) | |
87 | |
88 (defun gnus-mail-other-window-using-mail () | |
89 "Compose mail other window using mail." | |
90 (news-mail-other-window) | |
91 (gnus-overload-functions)) | |
92 | |
93 | |
94 ;;; Send mail using mh-e. | |
95 | |
96 ;; The following mh-e interface is all cooperative works of | |
97 ;; tanaka@flab.fujitsu.CO.JP (TANAKA Hiroshi), kawabe@sra.CO.JP | |
98 ;; (Yoshikatsu Kawabe), and shingu@casund.cpr.canon.co.jp (Toshiaki | |
99 ;; SHINGU). | |
100 | |
101 (defun gnus-mail-reply-using-mhe (&optional yank) | |
102 "Compose reply mail using mh-e. | |
103 Optional argument YANK means yank original article. | |
104 The command \\[mh-yank-cur-msg] yanks the original message into current buffer." | |
105 ;; First of all, prepare mhe mail buffer. | |
106 (let (from cc subject date to reply-to (buffer (current-buffer))) | |
107 (save-restriction | |
108 (gnus-Article-show-all-headers) ;I don't think this is really needed. | |
109 (setq from (gnus-fetch-field "from") | |
110 subject (let ((subject (gnus-fetch-field "subject"))) | |
111 (if (and subject | |
112 (not (string-match "^[Rr][Ee]:.+$" subject))) | |
113 (concat "Re: " subject) subject)) | |
114 reply-to (gnus-fetch-field "reply-to") | |
115 cc (gnus-fetch-field "cc") | |
116 date (gnus-fetch-field "date")) | |
117 (setq mh-show-buffer buffer) | |
118 (setq to (or reply-to from)) | |
119 (mh-find-path) | |
120 (mh-send to (or cc "") subject) | |
121 (save-excursion | |
122 (mh-insert-fields | |
123 "In-reply-to:" | |
124 (concat | |
125 (substring from 0 (string-match " *at \\| *@ \\| *(\\| *<" from)) | |
126 "'s message of " date))) | |
127 (setq mh-sent-from-folder buffer) | |
128 (setq mh-sent-from-msg 1) | |
129 )) | |
130 ;; Then, yank original article if requested. | |
131 (if yank | |
132 (let ((last (point))) | |
133 (mh-yank-cur-msg) | |
134 (goto-char last) | |
135 ))) | |
136 | |
137 (defun gnus-mail-other-window-using-mhe () | |
138 "Compose mail other window using MH-E Mail." | |
139 (let ((to (read-string "To: ")) | |
140 (cc (read-string "Cc: ")) | |
141 (subject (read-string "Subject: " (gnus-fetch-field "subject")))) | |
142 (gnus-Article-show-all-headers) ;I don't think this is really needed. | |
143 (setq mh-show-buffer (current-buffer)) | |
144 (mh-find-path) | |
145 (mh-send-other-window to cc subject) | |
146 (setq mh-sent-from-folder (current-buffer)) | |
147 (setq mh-sent-from-msg 1))) | |
584 | 148 |
149 (provide 'gnusmail) | |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
150 |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
151 ;;; gnusmail.el ends here |