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