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