annotate lisp/gnus/gnus-msg.el @ 30:ec9a17fef872 r19-15b98

Import from CVS: tag r19-15b98
author cvs
date Mon, 13 Aug 2007 08:52:29 +0200
parents 8fc7fe29b841
children e04119814345
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; gnus-msg.el --- mail and post interface for Gnus
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
2 ;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (require 'gnus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (require 'gnus-ems)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (require 'message)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
32 (require 'gnus-art)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; Added by Sudish Joseph <joseph@cis.ohio-state.edu>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defvar gnus-post-method nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 "*Preferred method for posting USENET news.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 If this variable is nil, Gnus will use the current method to decide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 which method to use when posting. If it is non-nil, it will override
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 the current method. This method will not be used in mail groups and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 the like, only in \"real\" newsgroups.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 The value must be a valid method as discussed in the documentation of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 `gnus-select-method'. It can also be a list of methods. If that is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 the case, the user will be queried for what select method to use when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 posting.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defvar gnus-outgoing-message-group nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 "*All outgoing messages will be put in this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 If you want to store all your outgoing mail and articles in the group
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
50 \"nnml:archive\", you set this variable to that value. This variable
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
51 can also be a list of group names.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 If you want to have greater control over what group to put each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 message in, you can set this variable to a function that checks the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 current newsgroup name and then returns a suitable group name (or list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 of names).")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (defvar gnus-mailing-list-groups nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 "*Regexp matching groups that are really mailing lists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 This is useful when you're reading a mailing list that has been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 gatewayed to a newsgroup, and you want to followup to an article in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 the group.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
64 (defvar gnus-sent-message-ids-file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (nnheader-concat gnus-directory "Sent-Message-IDs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 "File where Gnus saves a cache of sent message ids.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (defvar gnus-sent-message-ids-length 1000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 "The number of sent Message-IDs to save.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
71 (defvar gnus-crosspost-complaint
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
72 "Hi,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
73
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
74 You posted the article below with the following Newsgroups header:
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
75
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
76 Newsgroups: %s
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
77
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
78 The %s group, at least, was an inappropriate recipient
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
79 of this message. Please trim your Newsgroups header to exclude this
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
80 group before posting in the future.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
81
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
82 Thank you.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
83
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
84 "
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
85 "Format string to be inserted when complaining about crossposts.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
86 The first %s will be replaced by the Newsgroups header;
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
87 the second with the current group name.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
88
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
89 (defvar gnus-message-setup-hook nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
90 "Hook run after setting up a message buffer.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
91
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ;;; Internal variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (defvar gnus-message-buffer "*Mail Gnus*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (defvar gnus-article-copy nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (defvar gnus-last-posting-server nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
98 (defconst gnus-bug-message
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
99 "Sending a bug report to the Gnus Towers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
100 ========================================
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
101
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
102 The buffer below is a mail buffer. When you press `C-c C-c', it will
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
103 be sent to the Gnus Bug Exterminators.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
104
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
105 At the bottom of the buffer you'll see lots of variable settings.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
106 Please do not delete those. They will tell the Bug People what your
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
107 environment is, so that it will be easier to locate the bugs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
108
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
109 If you have found a bug that makes Emacs go \"beep\", set
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
110 debug-on-error to t (`M-x set-variable RET debug-on-error RET t RET')
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
111 and include the backtrace in your bug report.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
112
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
113 Please describe the bug in annoying, painstaking detail.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
114
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
115 Thank you for your help in stamping out bugs.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
116 ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
117
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (eval-and-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (autoload 'gnus-uu-post-news "gnus-uu" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (autoload 'news-setup "rnewspost")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (autoload 'news-reply-mode "rnewspost")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (autoload 'rmail-dont-reply-to "mail-utils")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (autoload 'rmail-output "rmailout"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;;; Gnus Posting Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
130 (gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
131 "p" gnus-summary-post-news
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
132 "f" gnus-summary-followup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
133 "F" gnus-summary-followup-with-original
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
134 "c" gnus-summary-cancel-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
135 "s" gnus-summary-supersede-article
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
136 "r" gnus-summary-reply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
137 "R" gnus-summary-reply-with-original
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
138 "w" gnus-summary-wide-reply
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
139 "W" gnus-summary-wide-reply-with-original
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
140 "n" gnus-summary-followup-to-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
141 "N" gnus-summary-followup-to-mail-with-original
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
142 "m" gnus-summary-mail-other-window
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
143 "u" gnus-uu-post-news
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
144 "\M-c" gnus-summary-mail-crosspost-complaint
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
145 "om" gnus-summary-mail-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
146 "op" gnus-summary-post-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
147 "Om" gnus-uu-digest-mail-forward
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
148 "Op" gnus-uu-digest-post-forward)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
150 (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
151 "b" gnus-summary-resend-bounced-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
152 ;; "c" gnus-summary-send-draft
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
153 "r" gnus-summary-resend-message)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ;;; Internal functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (defvar gnus-article-reply nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (defmacro gnus-setup-message (config &rest forms)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (let ((winconf (make-symbol "winconf"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (buffer (make-symbol "buffer"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (article (make-symbol "article")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 `(let ((,winconf (current-window-configuration))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
163 (,buffer (buffer-name (current-buffer)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (,article (and gnus-article-reply (gnus-summary-article-number)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (message-header-setup-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (copy-sequence message-header-setup-hook)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
169 (unwind-protect
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
170 ,@forms
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
171 (gnus-inews-add-send-actions ,winconf ,buffer ,article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
172 (setq gnus-message-buffer (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
173 (make-local-variable 'gnus-newsgroup-name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
174 (run-hooks 'gnus-message-setup-hook))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (gnus-configure-windows ,config t))))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
176
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defun gnus-inews-add-send-actions (winconf buffer article)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
178 (make-local-hook 'message-sent-hook)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (gnus-add-hook 'message-sent-hook 'gnus-inews-do-gcc nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (setq message-post-method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 `(lambda (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (gnus-post-method arg ,gnus-newsgroup-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (setq message-newsreader (setq message-mailer (gnus-extended-version)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (message-add-action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 `(set-window-configuration ,winconf) 'exit 'postpone 'kill)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (message-add-action
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
187 `(when (buffer-name (get-buffer ,buffer))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (save-excursion
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
189 (set-buffer (get-buffer ,buffer))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ,(when article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 `(gnus-summary-mark-article-as-replied ,article))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 'send))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (put 'gnus-setup-message 'lisp-indent-function 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (put 'gnus-setup-message 'edebug-form-spec '(form body))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;;; Post news commands of Gnus group mode and summary mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (defun gnus-group-mail ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 "Start composing a mail."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (gnus-setup-message 'message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (message-mail)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defun gnus-group-post-news (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 "Start composing a news message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 If ARG, post to the group under point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 If ARG is 1, prompt for a group name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ;; Bind this variable here to make message mode hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ;; work ok.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (let ((gnus-newsgroup-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (if (= 1 (prefix-numeric-value arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (completing-read "Newsgroup: " gnus-active-hashtb nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (gnus-read-active-file-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (gnus-group-group-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (gnus-post-news 'post gnus-newsgroup-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (defun gnus-summary-post-news ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 "Start composing a news message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (gnus-set-global-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (gnus-post-news 'post gnus-newsgroup-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (defun gnus-summary-followup (yank &optional force-news)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 "Compose a followup to an article.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 If prefix argument YANK is non-nil, original article is yanked automatically."
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
230 (interactive
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
231 (list (and current-prefix-arg
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (gnus-summary-work-articles 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (gnus-set-global-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (when yank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (gnus-summary-goto-subject (car yank)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (gnus-summary-select-article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (let ((headers (gnus-summary-article-header (gnus-summary-article-number)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (gnus-newsgroup-name gnus-newsgroup-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ;; Send a followup.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (gnus-post-news nil gnus-newsgroup-name
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
242 headers gnus-article-buffer
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 yank nil force-news)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (defun gnus-summary-followup-with-original (n &optional force-news)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 "Compose a followup to an article and include the original article."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (gnus-summary-followup (gnus-summary-work-articles n) force-news))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
250 (defun gnus-summary-followup-to-mail (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
251 "Followup to the current mail message via news."
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
252 (interactive
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
253 (list (and current-prefix-arg
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
254 (gnus-summary-work-articles 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
255 (gnus-summary-followup arg t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
256
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
257 (defun gnus-summary-followup-to-mail-with-original (&optional arg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
258 "Followup to the current mail message via news."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
259 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
260 (gnus-summary-followup (gnus-summary-work-articles arg) t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
261
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (defun gnus-inews-yank-articles (articles)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (let (beg article)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
264 (message-goto-body)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (while (setq article (pop articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (set-buffer gnus-summary-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (gnus-summary-select-article nil nil nil article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (gnus-summary-remove-process-mark article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (gnus-copy-article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (let ((message-reply-buffer gnus-article-copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (message-reply-headers gnus-current-headers))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (message-yank-original)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (setq beg (or beg (mark t))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
275 (when articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
276 (insert "\n")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (push-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (goto-char beg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (defun gnus-summary-cancel-article (n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 "Cancel an article you posted."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (gnus-set-global-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (let ((articles (gnus-summary-work-articles n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (message-post-method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 `(lambda (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (gnus-post-method nil ,gnus-newsgroup-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (while (setq article (pop articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (when (gnus-summary-select-article t nil nil article)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
291 (when (gnus-eval-in-buffer-window gnus-original-article-buffer
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
292 (message-cancel-news))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (gnus-summary-mark-as-read article gnus-canceled-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (gnus-cache-remove-article 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (gnus-article-hide-headers-if-wanted))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (gnus-summary-remove-process-mark article))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (defun gnus-summary-supersede-article ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 "Compose an article that will supersede a previous article.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 This is done simply by taking the old article and adding a Supersedes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 header line with the old Message-ID."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (gnus-set-global-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (let ((article (gnus-summary-article-number)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (gnus-setup-message 'reply-yank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (gnus-summary-select-article t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (set-buffer gnus-original-article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (message-supersede)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (push
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 `((lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (gnus-cache-possibly-remove-article ,article nil nil nil t)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
312 message-send-actions)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
313 (push
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
314 `((lambda ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
315 (when (buffer-name (get-buffer ,gnus-summary-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
316 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
317 (set-buffer (get-buffer ,gnus-summary-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
318 (gnus-summary-mark-as-read ,article gnus-canceled-mark)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 message-send-actions))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (defun gnus-copy-article-buffer (&optional article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 ;; make a copy of the article buffer with all text properties removed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 ;; this copy is in the buffer gnus-article-copy.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 ;; this buffer should be passed to all mail/news reply/post routines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (setq gnus-article-copy (get-buffer-create " *gnus article copy*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (buffer-disable-undo gnus-article-copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (or (memq gnus-article-copy gnus-buffer-list)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
331 (push gnus-article-copy gnus-buffer-list))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (let ((article-buffer (or article-buffer gnus-article-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 end beg contents)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
334 (if (not (and (get-buffer article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
335 (buffer-name (get-buffer article-buffer))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
336 (error "Can't find any article buffer")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (set-buffer article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (save-restriction
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
340 ;; Copy over the (displayed) article buffer, delete
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
341 ;; hidden text and remove text properties.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (widen)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
343 (copy-to-buffer gnus-article-copy (point-min) (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
344 (set-buffer gnus-article-copy)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
345 (gnus-article-delete-text-of-type 'annotation)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
346 (gnus-remove-text-with-property 'gnus-prev)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
347 (gnus-remove-text-with-property 'gnus-next)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
348 (insert
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
349 (prog1
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
350 (format "%s" (buffer-string))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
351 (erase-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
352 ;; Find the original headers.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (set-buffer gnus-original-article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (while (looking-at message-unix-mail-delimiter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (setq beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (setq end (or (search-forward "\n\n" nil t) (point)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
359 ;; Delete the headers from the displayed articles.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (set-buffer gnus-article-copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (delete-region (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (or (search-forward "\n\n" nil t) (point)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
363 ;; Insert the original article headers.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
364 (insert-buffer-substring gnus-original-article-buffer beg end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
365 (gnus-article-decode-rfc1522)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 gnus-article-copy)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (defun gnus-post-news (post &optional group header article-buffer yank subject
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 force-news)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (when article-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (gnus-copy-article-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (let ((gnus-article-reply article-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (gnus-setup-message (cond (yank 'reply-yank)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (article-buffer 'reply)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (t 'message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (let* ((group (or group gnus-newsgroup-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (pgroup group)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
378 to-address to-group mailing-list to-list
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
379 newsgroup-p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (when group
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
381 (setq to-address (gnus-group-find-parameter group 'to-address)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
382 to-group (gnus-group-find-parameter group 'to-group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
383 to-list (gnus-group-find-parameter group 'to-list)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
384 newsgroup-p (gnus-group-find-parameter group 'newsgroup)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 mailing-list (when gnus-mailing-list-groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (string-match gnus-mailing-list-groups group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 group (gnus-group-real-name group)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (if (or (and to-group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (gnus-news-group-p to-group))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
390 newsgroup-p
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 force-news
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
392 (and (gnus-news-group-p
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (or pgroup gnus-newsgroup-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (if header (mail-header-number header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 gnus-current-article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (not mailing-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (not to-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (not to-address)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 ;; This is news.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (if post
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (message-news (or to-group group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (set-buffer gnus-article-copy)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
403 (message-followup (if (or newsgroup-p force-news) nil to-group)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 ;; The is mail.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (if post
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (message-mail (or to-address to-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 ;; Arrange for mail groups that have no `to-address' to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;; get that when the user sends off the mail.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (push (list 'gnus-inews-add-to-address group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 message-send-actions))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (set-buffer gnus-article-copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (message-wide-reply to-address)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (when yank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (gnus-inews-yank-articles yank))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (defun gnus-post-method (arg group &optional silent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 "Return the posting method based on GROUP and ARG.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 If SILENT, don't prompt the user."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (let ((group-method (gnus-find-method-for-group group)))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
421 (cond
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
422 ;; If the group-method is nil (which shouldn't happen) we use
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 ;; the default method.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
424 ((null group-method)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (or gnus-post-method gnus-select-method message-post-method))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 ;; We want this group's method.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 ((and arg (not (eq arg 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 group-method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 ;; We query the user for a post method.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 ((or arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (and gnus-post-method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (listp (car gnus-post-method))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (let* ((methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 ;; Collect all methods we know about.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (when gnus-post-method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (if (listp (car gnus-post-method))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 gnus-post-method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (list gnus-post-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 gnus-secondary-select-methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (list gnus-select-method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (list group-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 method-alist post-methods method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 ;; Weed out all mail methods.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (while methods
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (setq method (gnus-server-get-method "" (pop methods)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (when (or (gnus-method-option-p method 'post)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (gnus-method-option-p method 'post-mail))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (push method post-methods)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 ;; Create a name-method alist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (setq method-alist
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
452 (mapcar
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (lambda (m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (list (concat (cadr m) " (" (symbol-name (car m)) ")") m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 post-methods))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 ;; Query the user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (cadr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (setq gnus-last-posting-server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (if (and silent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 gnus-last-posting-server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 ;; Just use the last value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 gnus-last-posting-server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 "Posting method: " method-alist nil t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (cons (or gnus-last-posting-server "") 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 method-alist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 ;; Override normal method.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
469 (gnus-post-method
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 gnus-post-method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ;; Use the normal select method.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (t gnus-select-method))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (defun gnus-inews-narrow-to-headers ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (narrow-to-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (goto-char (point-min))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
478 (or (and (re-search-forward
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (concat "^" (regexp-quote mail-header-separator) "$") nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (goto-char (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 ;;; Check whether the message has been sent already.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (defvar gnus-inews-sent-ids nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (defun gnus-inews-reject-message ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 "Check whether this message has already been sent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (when gnus-sent-message-ids-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (let ((message-id (save-restriction (gnus-inews-narrow-to-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (mail-fetch-field "message-id")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (when message-id
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (unless gnus-inews-sent-ids
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
498 (ignore-errors
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
499 (load t t t)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (if (member message-id gnus-inews-sent-ids)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 ;; Reject this message.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
502 (not (gnus-yes-or-no-p
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (format "Message %s already sent. Send anyway? "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 message-id)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (push message-id gnus-inews-sent-ids)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 ;; Chop off the last Message-IDs.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
507 (when (setq end (nthcdr gnus-sent-message-ids-length
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 gnus-inews-sent-ids))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (setcdr end nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (nnheader-temp-write gnus-sent-message-ids-file
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
511 (gnus-prin1 `(setq gnus-inews-sent-ids ',gnus-inews-sent-ids)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 nil)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 ;; Dummy to avoid byte-compile warning.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (defvar nnspool-rejected-article-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 ;;; Since the X-Newsreader/X-Mailer are ``vanity'' headers, they might
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 ;;; as well include the Emacs version as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 ;;; The following function works with later GNU Emacs, and XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (defun gnus-extended-version ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 "Stringified Gnus version and Emacs version"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 gnus-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 ((string-match "^\\([0-9]+\\.[0-9]+\\)\\.[.0-9]+$" emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (concat "Emacs " (substring emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (match-end 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 ((string-match "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)" emacs-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (concat (substring emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (format " %d.%d" emacs-major-version emacs-minor-version)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (t emacs-version))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
540 ;; Written by "Mr. Per Persson" <pp@gnu.ai.mit.edu>.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (defun gnus-inews-insert-mime-headers ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (goto-char (point-min))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
543 (let ((mail-header-separator
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
544 (progn
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (if (and (search-forward (concat "\n" mail-header-separator "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (not (search-backward "\n\n" nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 mail-header-separator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (or (mail-position-on-field "Mime-Version")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (insert "1.0")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (cond ((save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (re-search-forward "[\200-\377]" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (or (mail-position-on-field "Content-Type")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (insert "text/plain; charset=ISO-8859-1"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (or (mail-position-on-field "Content-Transfer-Encoding")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (insert "8bit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (t (or (mail-position-on-field "Content-Type")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (insert "text/plain; charset=US-ASCII"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (or (mail-position-on-field "Content-Transfer-Encoding")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (insert "7bit")))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 ;;;
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
568 ;;; Gnus Mail Functions
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 ;;; Mail reply commands of Gnus summary mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
573 (defun gnus-summary-reply (&optional yank wide)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
574 "Start composing a reply mail to the current message.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
575 If prefix argument YANK is non-nil, the original article is yanked
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
576 automatically."
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
577 (interactive
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
578 (list (and current-prefix-arg
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (gnus-summary-work-articles 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 ;; Stripping headers should be specified with mail-yank-ignored-headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (gnus-set-global-variables)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
582 (when yank
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (gnus-summary-goto-subject (car yank)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (let ((gnus-article-reply t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (gnus-setup-message (if yank 'reply-yank 'reply)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (gnus-summary-select-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (set-buffer (gnus-copy-article-buffer))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
588 (message-reply nil wide (gnus-group-find-parameter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
589 gnus-newsgroup-name 'broken-reply-to))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (when yank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (gnus-inews-yank-articles yank)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
593 (defun gnus-summary-reply-with-original (n &optional wide)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
594 "Start composing a reply mail to the current message.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
595 The original article will be yanked."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (interactive "P")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 16
diff changeset
597 (gnus-summary-reply (gnus-summary-work-articles n) wide))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
599 (defun gnus-summary-wide-reply (&optional yank)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
600 "Start composing a wide reply mail to the current message.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
601 If prefix argument YANK is non-nil, the original article is yanked
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
602 automatically."
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
603 (interactive
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
604 (list (and current-prefix-arg
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
605 (gnus-summary-work-articles 1))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
606 (gnus-summary-reply yank t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
607
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
608 (defun gnus-summary-wide-reply-with-original (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
609 "Start composing a wide reply mail to the current message.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
610 The original article will be yanked."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
611 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
612 (gnus-summary-reply-with-original n t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
613
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
614 (defun gnus-summary-mail-forward (&optional full-headers post)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
615 "Forward the current message to another user.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
616 If FULL-HEADERS (the prefix), include full headers when forwarding."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (gnus-set-global-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 (gnus-setup-message 'forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (gnus-summary-select-article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (set-buffer gnus-original-article-buffer)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
622 (let ((message-included-forward-headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
623 (if full-headers "" message-included-forward-headers)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
624 (message-forward post))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
626 (defun gnus-summary-resend-message (address n)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 "Resend the current article to ADDRESS."
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
628 (interactive "sResend message(s) to: \nP")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
629 (let ((articles (gnus-summary-work-articles n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
630 article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
631 (while (setq article (pop articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
632 (gnus-summary-select-article nil nil nil article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
633 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
634 (set-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
635 (message-resend address)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
637 (defun gnus-summary-post-forward (&optional full-headers)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
638 "Forward the current article to a newsgroup.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
639 If FULL-HEADERS (the prefix), include full headers when forwarding."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
640 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
641 (gnus-summary-mail-forward full-headers t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
643 (defvar gnus-nastygram-message
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
644 "The following article was inappropriately posted to %s.\n\n"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 "Format string to insert in nastygrams.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 The current group name will be inserted at \"%s\".")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (defun gnus-summary-mail-nastygram (n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 "Send a nastygram to the author of the current article."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (interactive "P")
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
651 (when (or gnus-expert-user
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
652 (gnus-y-or-n-p
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
653 "Really send a nastygram to the author of the current article? "))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
654 (let ((group gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
655 (gnus-summary-reply-with-original n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
656 (set-buffer gnus-message-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
657 (message-goto-body)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
658 (insert (format gnus-nastygram-message group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
659 (message-send-and-exit))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
660
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
661 (defun gnus-summary-mail-crosspost-complaint (n)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
662 "Send a complaint about crossposting to the current article(s)."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
663 (interactive "P")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
664 (let ((articles (gnus-summary-work-articles n))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
665 article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
666 (while (setq article (pop articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
667 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
668 (gnus-summary-goto-subject article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
669 (let ((group (gnus-group-real-name gnus-newsgroup-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
670 newsgroups followup-to)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
671 (gnus-summary-select-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
672 (set-buffer gnus-original-article-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
673 (if (and (<= (length (message-tokenize-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
674 (setq newsgroups (mail-fetch-field "newsgroups"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
675 ", "))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
676 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
677 (or (not (setq followup-to (mail-fetch-field "followup-to")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
678 (not (member group (message-tokenize-header
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
679 followup-to ", ")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
680 (if followup-to
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
681 (gnus-message 1 "Followup-to restricted")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
682 (gnus-message 1 "Not a crossposted article"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
683 (set-buffer gnus-summary-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
684 (gnus-summary-reply-with-original 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
685 (set-buffer gnus-message-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
686 (message-goto-body)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
687 (insert (format gnus-crosspost-complaint newsgroups group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
688 (message-goto-subject)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
689 (re-search-forward " *$")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
690 (replace-match " (crosspost notification)" t t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
691 (when (gnus-y-or-n-p "Send this complaint? ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
692 (message-send-and-exit)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (defun gnus-summary-mail-other-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 "Compose mail in other window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (gnus-setup-message 'message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (message-mail)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (defun gnus-mail-parse-comma-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 (let (accumulated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (skip-chars-forward " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 (while (not (eobp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 (setq beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (skip-chars-forward "^,")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 (while (zerop
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
708 (save-excursion
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (let ((i 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (narrow-to-region beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (goto-char beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (logand (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (while (search-forward "\"" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (incf i))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
716 (if (zerop i) 2 i))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
717 2)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (skip-chars-forward ",")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (skip-chars-forward "^,"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (skip-chars-backward " ")
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
721 (push (buffer-substring beg (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
722 accumulated)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (skip-chars-forward "^,")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 (skip-chars-forward ", "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 accumulated))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (defun gnus-inews-add-to-address (group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 (let ((to-address (mail-fetch-field "to")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (when (and to-address
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (gnus-alive-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 ;; This mail group doesn't have a `to-list', so we add one
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
732 ;; here. Magic!
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (gnus-group-add-parameter group (cons 'to-list to-address)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (defun gnus-put-message ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 "Put the current message in some group and return to Gnus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 (let ((reply gnus-article-reply)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (winconf gnus-prev-winconf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 (group gnus-newsgroup-name))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
741
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (or (and group (not (gnus-group-read-only-p group)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (setq group (read-string "Put in group: " nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (gnus-writable-groups))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
745 (when (gnus-gethash group gnus-newsrc-hashtb)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
746 (error "No such group: %s" group))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (gnus-inews-narrow-to-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (let (gnus-deletable-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (if (message-news-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (message-generate-headers message-required-news-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (message-generate-headers message-required-mail-headers)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (insert "Gcc: " group "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (widen)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (gnus-inews-do-gcc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
762 (when (get-buffer gnus-group-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
763 (when (gnus-buffer-exists-p (car-safe reply))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
764 (set-buffer (car reply))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
765 (and (cdr reply)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
766 (gnus-summary-mark-article-as-replied
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
767 (cdr reply))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
768 (when winconf
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
769 (set-window-configuration winconf)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 (defun gnus-article-mail (yank)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 "Send a reply to the address near point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 If YANK is non-nil, include the original article."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (interactive "P")
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
775 (let ((address
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (save-excursion (re-search-backward "[ \t\n]" nil t) (1+ (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 (when address
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (message-reply address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (when yank
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
782 (gnus-inews-yank-articles (list (cdr gnus-article-current)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
784 (defvar nntp-server-type)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (defun gnus-bug ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 "Send a bug report to the Gnus maintainers."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (interactive)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
788 (unless (gnus-alive-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
789 (error "Gnus has been shut down"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (gnus-setup-message 'bug
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 (delete-other-windows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (switch-to-buffer "*Gnus Help Bug*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (insert gnus-bug-message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 (message-pop-to-buffer "*Gnus Bug*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 (message-setup `((To . ,gnus-maintainer) (Subject . "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (push `(gnus-bug-kill-buffer) message-send-actions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (insert (gnus-version) "\n")
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
803 (insert (emacs-version) "\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
804 (when (and (boundp 'nntp-server-type)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
805 (stringp nntp-server-type))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
806 (insert nntp-server-type))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (insert "\n\n\n\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 (gnus-debug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 (search-forward "Subject: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (message "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 (defun gnus-bug-kill-buffer ()
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
814 (when (get-buffer "*Gnus Help Bug*")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
815 (kill-buffer "*Gnus Help Bug*")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 (defun gnus-debug ()
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
818 "Attempts to go through the Gnus source file and report what variables have been changed.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 The source file has to be in the Emacs load path."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (interactive)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
821 (let ((files '("gnus.el" "gnus-sum.el" "gnus-group.el"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
822 "gnus-art.el" "gnus-start.el" "gnus-async.el"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
823 "gnus-msg.el" "gnus-score.el" "gnus-win.el"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
824 "nnmail.el" "message.el"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
825 file expr olist sym)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (gnus-message 4 "Please wait while we snoop your variables...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (sit-for 0)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
828 ;; Go through all the files looking for non-default values for variables.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (set-buffer (get-buffer-create " *gnus bug info*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 (buffer-disable-undo (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 (while files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 (erase-buffer)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
834 (when (and (setq file (locate-library (pop files)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
835 (file-exists-p file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
836 (insert-file-contents file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
837 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
838 (if (not (re-search-forward "^;;* *Internal variables" nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
839 (gnus-message 4 "Malformed sources in file %s" file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
840 (narrow-to-region (point-min) (point))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
842 (while (setq expr (ignore-errors (read (current-buffer))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
843 (ignore-errors
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
844 (and (or (eq (car expr) 'defvar)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
845 (eq (car expr) 'defcustom))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
846 (stringp (nth 3 expr))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
847 (or (not (boundp (nth 1 expr)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
848 (not (equal (eval (nth 2 expr))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
849 (symbol-value (nth 1 expr)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
850 (push (nth 1 expr) olist)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 (kill-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (when (setq olist (nreverse olist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 (insert "------------------ Environment follows ------------------\n\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 (while olist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 (if (boundp (car olist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (pp `(setq ,(car olist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 ,(if (or (consp (setq sym (symbol-value (car olist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (and (symbolp sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (not (or (eq sym nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (eq sym t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 (list 'quote (symbol-value (car olist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (symbol-value (car olist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (format "(setq %s 'whatever)\n" (car olist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 (insert ";; (makeunbound '" (symbol-name (car olist)) ")\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 (setq olist (cdr olist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 (insert "\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 ;; Remove any null chars - they seem to cause trouble for some
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
871 ;; mailers. (Byte-compiled output from the stuff above.)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (while (re-search-forward "[\000\200]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (replace-match "" t t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 ;;; Treatment of rejected articles.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 ;;; Bounced mail.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (defun gnus-summary-resend-bounced-mail (&optional fetch)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 "Re-mail the current message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 This only makes sense if the current message is a bounce message than
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 contains some mail you have written which has been bounced back to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 you.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 If FETCH, try to fetch the article that this is a reply to, if indeed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 this is a reply."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 (gnus-summary-select-article t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (set-buffer gnus-original-article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (gnus-setup-message 'compose-bounce
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 (let* ((references (mail-fetch-field "references"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (parent (and references (gnus-parent-id references))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (message-bounce)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
893 ;; If there are references, we fetch the article we answered to.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 (and fetch parent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 (gnus-summary-refer-article parent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 (gnus-summary-show-all-headers)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 ;;; Gcc handling.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
900 ;; Do Gcc handling, which copied the message over to some group.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 (defun gnus-inews-do-gcc (&optional gcc)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
902 (interactive)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 (when (gnus-alive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 (message-narrow-to-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (let ((gcc (or gcc (mail-fetch-field "gcc" nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 (cur (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 groups group method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 (when gcc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 (message-remove-header "gcc")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 (setq groups (message-tokenize-header gcc " ,"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 ;; Copy the article over to some group(s).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 (while (setq group (pop groups))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
916 (gnus-check-server
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 (setq method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 (cond ((and (null (gnus-get-info group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 (eq (car gnus-message-archive-method)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
920 (car
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 (gnus-server-to-method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 (gnus-group-method group)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 ;; If the group doesn't exist, we assume
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 ;; it's an archive group...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 gnus-message-archive-method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 ;; Use the method.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 ((gnus-info-method (gnus-get-info group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 (gnus-info-method (gnus-get-info group)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 ;; Find the method.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 (t (gnus-group-method group)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 (gnus-check-server method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 (unless (gnus-request-group group t method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 (gnus-request-create-group group method))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 (nnheader-set-temp-buffer " *acc*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 (insert-buffer-substring cur)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 (goto-char (point-min))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
938 (when (re-search-forward
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 (concat "^" (regexp-quote mail-header-separator) "$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 (replace-match "" t t ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 (unless (gnus-request-accept-article group method t)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
943 (gnus-message 1 "Couldn't store article in group %s: %s"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 group (gnus-status-message method))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 (sit-for 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (kill-buffer (current-buffer))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (defun gnus-inews-insert-gcc ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 "Insert Gcc headers based on `gnus-outgoing-message-group'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 (gnus-inews-narrow-to-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 (let* ((group gnus-outgoing-message-group)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
954 (gcc (cond
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 ((gnus-functionp group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 (funcall group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 ((or (stringp group) (list group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 group))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 (when gcc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 (insert "Gcc: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (if (stringp gcc) gcc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 (mapconcat 'identity gcc " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 "\n"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (defun gnus-inews-insert-archive-gcc (&optional group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "Insert the Gcc to say where the article is to be archived."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (let* ((var gnus-message-archive-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (group (or group gnus-newsgroup-name ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 result
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
970 gcc-self-val
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (groups
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
972 (cond
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 ((null gnus-message-archive-method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 ;; Ignore.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 ((stringp var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 ;; Just a single group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 (list var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 ((null var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 ;; We don't want this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 ((and (listp var) (stringp (car var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 ;; A list of groups.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 ((gnus-functionp var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 ;; A function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 (funcall var group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 ;; An alist of regexps/functions/forms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (while (and var
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 (setq result
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
993 (cond
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 ((stringp (caar var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 ;; Regexp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 (when (string-match (caar var) group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (cdar var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 ((gnus-functionp (car var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 ;; Function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (funcall (car var) group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 (eval (car var)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (setq var (cdr var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 result)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 (when groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (when (stringp groups)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (setq groups (list groups)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (gnus-inews-narrow-to-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 (insert "Gcc: ")
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1014 (if (and gnus-newsgroup-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1015 (setq gcc-self-val
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1016 (gnus-group-find-parameter
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1017 gnus-newsgroup-name 'gcc-self)))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
1018 (progn
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1019 (insert
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1020 (if (stringp gcc-self-val)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1021 gcc-self-val
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1022 group))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1023 (if (not (eq gcc-self-val 'none))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1024 (insert "\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1025 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1026 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1027 (kill-line))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1028 (while (setq name (pop groups))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1029 (insert (if (string-match ":" name)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1030 name
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
1031 (gnus-group-prefixed-name
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1032 name gnus-message-archive-method)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1033 (when groups
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1034 (insert " ")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
1035 (insert "\n")))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 (defun gnus-summary-send-draft ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 "Enter a mail/post buffer to edit and send the draft."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (gnus-set-global-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 (let (buf)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
1042 (if (not (setq buf (gnus-request-restore-buffer
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 (gnus-summary-article-number) gnus-newsgroup-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 (error "Couldn't restore the article")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (switch-to-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 (when (eq major-mode 'news-reply-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 (local-set-key "\C-c\C-c" 'gnus-inews-news))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 ;; Insert the separator.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 (search-forward "\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (insert mail-header-separator)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 ;; Configure windows.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (let ((gnus-draft-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 (gnus-configure-windows 'draft t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 (goto-char (point))))))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
1057
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 (gnus-add-shutdown 'gnus-inews-close 'gnus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 (defun gnus-inews-close ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 (setq gnus-inews-sent-ids nil))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 22
diff changeset
1062
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 ;;; Allow redefinition of functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 (gnus-ems-redefine)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 (provide 'gnus-msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 ;;; gnus-msg.el ends here