annotate lisp/=gnusmail.el @ 667:ded061ae23c8

*** empty log message ***
author Noah Friedman <friedman@splode.com>
date Sun, 31 May 1992 21:09:48 +0000
parents 08eb386dd0f3
children d18c8feb66bd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 ;; Copyright (C) 1990 Masanobu UMEDA
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 ;; $Header: gnusmail.el,v 1.1 90/03/23 13:24:39 umerin Locked $
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 ;; This file is part of GNU Emacs.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; GNU Emacs is distributed in the hope that it will be useful,
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 ;; but WITHOUT ANY WARRANTY. No author or distributor
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; accepts responsibility to anyone for the consequences of using it
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; or for whether it serves any particular purpose or works at all,
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 ;; unless he says so in writing. Refer to the GNU Emacs General Public
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; License for full details.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; Everyone is granted permission to copy, modify and redistribute
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 ;; GNU Emacs, but only under the conditions described in the
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; GNU Emacs General Public License. A copy of this license is
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; supposed to have been given to you along with GNU Emacs so you
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 ;; can know your rights and responsibilities. It should be in a
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; file named COPYING. Among other things, the copyright notice
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 ;; and this notice must be preserved on all copies.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 (require 'gnus)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 ;; Provides mail reply and mail other window command using usual mail
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 ;; interface and mh-e interface.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 ;;
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 ;; To use MAIL: set the variables gnus-mail-reply-method and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 ;; gnus-mail-other-window-method to gnus-mail-reply-using-mail and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 ;; gnus-mail-other-window-using-mail, respectively.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 ;;
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 ;; To use MH-E: set the variables gnus-mail-reply-method and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 ;; gnus-mail-other-window-method to gnus-mail-reply-using-mhe and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 ;; gnus-mail-other-window-using-mhe, respectively.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 (autoload 'news-mail-reply "rnewspost")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 (autoload 'news-mail-other-window "rnewspost")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 (autoload 'mh-send "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 (autoload 'mh-send-other-window "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 (autoload 'mh-find-path "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 (autoload 'mh-yank-cur-msg "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 ;;; Mail reply commands of GNUS Subject Mode
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 (defun gnus-Subject-mail-reply (yank)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 "Reply mail to news author.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 If prefix arg YANK is non-nil, original article is yanked automatically.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 Customize the variable `gnus-mail-reply-method' to use another mailer."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 (interactive "P")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 (gnus-Subject-select-article)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 (switch-to-buffer gnus-Article-buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 (widen)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 (delete-other-windows)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 (bury-buffer gnus-Article-buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 (funcall gnus-mail-reply-method yank))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 (defun gnus-Subject-mail-reply-with-original ()
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 "Reply mail to news author with original article."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 (interactive)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 (gnus-Subject-mail-reply t))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 (defun gnus-Subject-mail-other-window ()
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 "Compose mail in other window.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 Customize the variable `gnus-mail-other-window-method' to use another mailer."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 (interactive)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 (gnus-Subject-select-article)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 (switch-to-buffer gnus-Article-buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 (widen)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 (delete-other-windows)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 (bury-buffer gnus-Article-buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 (funcall gnus-mail-other-window-method))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 ;;; Send mail using sendmail mail mode.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 (defun gnus-mail-reply-using-mail (&optional yank)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 "Compose reply mail using mail.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79 Optional argument YANK means yank original article."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 (news-mail-reply)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 (gnus-overload-functions)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 (if yank
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 (let ((last (point)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 (goto-char (point-max))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 (mail-yank-original nil)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 (goto-char last)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 )))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 (defun gnus-mail-other-window-using-mail ()
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 "Compose mail other window using mail."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 (news-mail-other-window)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 (gnus-overload-functions))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 ;;; Send mail using mh-e.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 ;; The following mh-e interface is all cooperative works of
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 ;; tanaka@flab.fujitsu.CO.JP (TANAKA Hiroshi), kawabe@sra.CO.JP
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 ;; (Yoshikatsu Kawabe), and shingu@casund.cpr.canon.co.jp (Toshiaki
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 ;; SHINGU).
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 (defun gnus-mail-reply-using-mhe (&optional yank)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 "Compose reply mail using mh-e.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 Optional argument YANK means yank original article.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 The command \\[mh-yank-cur-msg] yanks the original message into current buffer."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 ;; First of all, prepare mhe mail buffer.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 (let (from cc subject date to reply-to (buffer (current-buffer)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 (save-restriction
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 (gnus-Article-show-all-headers) ;I don't think this is really needed.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 (setq from (gnus-fetch-field "from")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 subject (let ((subject (gnus-fetch-field "subject")))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 (if (and subject
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 (not (string-match "^[Rr][Ee]:.+$" subject)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 (concat "Re: " subject) subject))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 reply-to (gnus-fetch-field "reply-to")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 cc (gnus-fetch-field "cc")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 date (gnus-fetch-field "date"))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 (setq mh-show-buffer buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 (setq to (or reply-to from))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 (mh-find-path)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 (mh-send to (or cc "") subject)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 (save-excursion
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 (mh-insert-fields
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 "In-reply-to:"
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 (concat
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 (substring from 0 (string-match " *at \\| *@ \\| *(\\| *<" from))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 "'s message of " date)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 (setq mh-sent-from-folder buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 (setq mh-sent-from-msg 1)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 ))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 ;; Then, yank original article if requested.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 (if yank
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 (let ((last (point)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 (mh-yank-cur-msg)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 (goto-char last)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 )))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 (defun gnus-mail-other-window-using-mhe ()
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 "Compose mail other window using MH-E Mail."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 (let ((to (read-string "To: "))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 (cc (read-string "Cc: "))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 (subject (read-string "Subject: " (gnus-fetch-field "subject"))))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 (gnus-Article-show-all-headers) ;I don't think this is really needed.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 (setq mh-show-buffer (current-buffer))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 (mh-find-path)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 (mh-send-other-window to cc subject)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 (setq mh-sent-from-folder (current-buffer))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 (setq mh-sent-from-msg 1)))
584
4cd7543be581 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 205
diff changeset
149
4cd7543be581 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 205
diff changeset
150 (provide 'gnusmail)
660
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
151
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
152 ;;; gnusmail.el ends here