Mercurial > emacs
annotate lisp/gnus/gnus-msg.el @ 31760:65372422b281
*** empty log message ***
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 20 Sep 2000 10:56:02 +0000 |
parents | 9968f55ad26e |
children | 51cea22fd2aa |
rev | line source |
---|---|
17493 | 1 ;;; gnus-msg.el --- mail and post interface for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
2 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
3 ;; Free Software Foundation, Inc. |
17493 | 4 |
5 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
6 ;; Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
19531
f5b98be7c142
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
f5b98be7c142
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
31 |
17493 | 32 (require 'gnus) |
33 (require 'gnus-ems) | |
34 (require 'message) | |
35 (require 'gnus-art) | |
36 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
37 (defcustom gnus-post-method 'current |
17493 | 38 "*Preferred method for posting USENET news. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
39 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
40 If this variable is `current', Gnus will use the \"current\" select |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
41 method when posting. If it is nil (which is the default), Gnus will |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
42 use the native select method when posting. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
43 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
44 This method will not be used in mail groups and the like, only in |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
45 \"real\" newsgroups. |
17493 | 46 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
47 If not nil nor `native', the value must be a valid method as discussed |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
48 in the documentation of `gnus-select-method'. It can also be a list of |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
49 methods. If that is the case, the user will be queried for what select |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
50 method to use when posting." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
51 :group 'gnus-group-foreign |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
52 :type `(choice (const nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
53 (const current) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
54 (const native) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
55 (sexp :tag "Methods" ,gnus-select-method))) |
17493 | 56 |
57 (defvar gnus-outgoing-message-group nil | |
58 "*All outgoing messages will be put in this group. | |
59 If you want to store all your outgoing mail and articles in the group | |
60 \"nnml:archive\", you set this variable to that value. This variable | |
61 can also be a list of group names. | |
62 | |
63 If you want to have greater control over what group to put each | |
64 message in, you can set this variable to a function that checks the | |
65 current newsgroup name and then returns a suitable group name (or list | |
66 of names).") | |
67 | |
68 (defvar gnus-mailing-list-groups nil | |
69 "*Regexp matching groups that are really mailing lists. | |
70 This is useful when you're reading a mailing list that has been | |
71 gatewayed to a newsgroup, and you want to followup to an article in | |
72 the group.") | |
73 | |
74 (defvar gnus-add-to-list nil | |
75 "*If non-nil, add a `to-list' parameter automatically.") | |
76 | |
77 (defvar gnus-crosspost-complaint | |
78 "Hi, | |
79 | |
80 You posted the article below with the following Newsgroups header: | |
81 | |
82 Newsgroups: %s | |
83 | |
84 The %s group, at least, was an inappropriate recipient | |
85 of this message. Please trim your Newsgroups header to exclude this | |
86 group before posting in the future. | |
87 | |
88 Thank you. | |
89 | |
90 " | |
91 "Format string to be inserted when complaining about crossposts. | |
92 The first %s will be replaced by the Newsgroups header; | |
93 the second with the current group name.") | |
94 | |
95 (defvar gnus-message-setup-hook nil | |
96 "Hook run after setting up a message buffer.") | |
97 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
98 (defvar gnus-bug-create-help-buffer t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
99 "*Should we create the *Gnus Help Bug* buffer?") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
100 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
101 (defvar gnus-posting-styles nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
102 "*Alist of styles to use when posting.") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
103 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
104 (defcustom gnus-group-posting-charset-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
105 '(("^\\(no\\|fr\\|dk\\)\\.[^,]*\\(,[ \t\n]*\\(no\\|fr\\|dk\\)\\.[^,]*\\)*$" iso-8859-1 (iso-8859-1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
106 ("^\\(fido7\\|relcom\\)\\.[^,]*\\(,[ \t\n]*\\(fido7\\|relcom\\)\\.[^,]*\\)*$" koi8-r (koi8-r)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
107 (message-this-is-mail nil nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
108 (message-this-is-news nil t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
109 "Alist of regexps and permitted unencoded charsets for posting. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
110 Each element of the alist has the form (TEST HEADER BODY-LIST), where |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
111 TEST is either a regular expression matching the newsgroup header or a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
112 variable to query, |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
113 HEADER is the charset which may be left unencoded in the header (nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
114 means encode all charsets), |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
115 BODY-LIST is a list of charsets which may be encoded using 8bit |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
116 content-transfer encoding in the body, or one of the special values |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
117 nil (always encode using quoted-printable) or t (always use 8bit). |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
118 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
119 Note that any value other than nil for HEADER infringes some RFCs, so |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
120 use this option with care." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
121 :type '(repeat (list :tag "Permitted unencoded charsets" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
122 (choice :tag "Where" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
123 (regexp :tag "Group") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
124 (const :tag "Mail message" :value message-this-is-mail) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
125 (const :tag "News article" :value message-this-is-news)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
126 (choice :tag "Header" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
127 (const :tag "None" nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
128 (symbol :tag "Charset")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
129 (choice :tag "Body" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
130 (const :tag "Any" :value t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
131 (const :tag "None" :value nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
132 (repeat :tag "Charsets" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
133 (symbol :tag "Charset"))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
134 :group 'gnus-charset) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
135 |
17493 | 136 ;;; Internal variables. |
137 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
138 (defvar gnus-inhibit-posting-styles nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
139 "Inhibit the use of posting styles.") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
140 |
17493 | 141 (defvar gnus-message-buffer "*Mail Gnus*") |
142 (defvar gnus-article-copy nil) | |
143 (defvar gnus-last-posting-server nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
144 (defvar gnus-message-group-art nil) |
17493 | 145 |
146 (defconst gnus-bug-message | |
147 "Sending a bug report to the Gnus Towers. | |
148 ======================================== | |
149 | |
150 The buffer below is a mail buffer. When you press `C-c C-c', it will | |
151 be sent to the Gnus Bug Exterminators. | |
152 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
153 The thing near the bottom of the buffer is how the environment |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
154 settings will be included in the mail. Please do not delete that. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
155 They will tell the Bug People what your environment is, so that it |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
156 will be easier to locate the bugs. |
17493 | 157 |
158 If you have found a bug that makes Emacs go \"beep\", set | |
159 debug-on-error to t (`M-x set-variable RET debug-on-error RET t RET') | |
160 and include the backtrace in your bug report. | |
161 | |
162 Please describe the bug in annoying, painstaking detail. | |
163 | |
164 Thank you for your help in stamping out bugs. | |
165 ") | |
166 | |
167 (eval-and-compile | |
168 (autoload 'gnus-uu-post-news "gnus-uu" nil t) | |
169 (autoload 'news-setup "rnewspost") | |
170 (autoload 'news-reply-mode "rnewspost") | |
171 (autoload 'rmail-dont-reply-to "mail-utils") | |
172 (autoload 'rmail-output "rmailout")) | |
173 | |
174 | |
175 ;;; | |
176 ;;; Gnus Posting Functions | |
177 ;;; | |
178 | |
179 (gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map) | |
180 "p" gnus-summary-post-news | |
181 "f" gnus-summary-followup | |
182 "F" gnus-summary-followup-with-original | |
183 "c" gnus-summary-cancel-article | |
184 "s" gnus-summary-supersede-article | |
185 "r" gnus-summary-reply | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
186 "y" gnus-summary-yank-message |
17493 | 187 "R" gnus-summary-reply-with-original |
188 "w" gnus-summary-wide-reply | |
189 "W" gnus-summary-wide-reply-with-original | |
190 "n" gnus-summary-followup-to-mail | |
191 "N" gnus-summary-followup-to-mail-with-original | |
192 "m" gnus-summary-mail-other-window | |
193 "u" gnus-uu-post-news | |
194 "\M-c" gnus-summary-mail-crosspost-complaint | |
195 "om" gnus-summary-mail-forward | |
196 "op" gnus-summary-post-forward | |
197 "Om" gnus-uu-digest-mail-forward | |
198 "Op" gnus-uu-digest-post-forward) | |
199 | |
200 (gnus-define-keys (gnus-send-bounce-map "D" gnus-summary-send-map) | |
201 "b" gnus-summary-resend-bounced-mail | |
202 ;; "c" gnus-summary-send-draft | |
203 "r" gnus-summary-resend-message) | |
204 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
205 ;;;###autoload |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
206 (defun gnus-msg-mail (&rest args) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
207 "Start editing a mail message to be sent. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
208 Like `message-mail', but with Gnus paraphernalia, particularly the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
209 the Gcc: header for archiving purposes." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
210 (interactive) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
211 (gnus-setup-message 'message |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
212 (apply 'message-mail args))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
213 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
214 ;;;###autoload |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
215 (define-mail-user-agent 'gnus-user-agent |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
216 'gnus-msg-mail 'message-send-and-exit |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
217 'message-kill-buffer 'message-send-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
218 |
17493 | 219 ;;; Internal functions. |
220 | |
221 (defvar gnus-article-reply nil) | |
222 (defmacro gnus-setup-message (config &rest forms) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
223 (let ((winconf (make-symbol "gnus-setup-message-winconf")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
224 (buffer (make-symbol "gnus-setup-message-buffer")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
225 (article (make-symbol "gnus-setup-message-article")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
226 (group (make-symbol "gnus-setup-message-group"))) |
17493 | 227 `(let ((,winconf (current-window-configuration)) |
228 (,buffer (buffer-name (current-buffer))) | |
229 (,article (and gnus-article-reply (gnus-summary-article-number))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
230 (,group gnus-newsgroup-name) |
17493 | 231 (message-header-setup-hook |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
232 (copy-sequence message-header-setup-hook)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
233 (mbl mml-buffer-list) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
234 (message-mode-hook (copy-sequence message-mode-hook))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
235 (setq mml-buffer-list nil) |
17493 | 236 (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc) |
237 (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
238 (add-hook 'message-mode-hook 'gnus-configure-posting-styles) |
17493 | 239 (unwind-protect |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
240 (progn |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
241 ,@forms) |
17493 | 242 (gnus-inews-add-send-actions ,winconf ,buffer ,article) |
243 (setq gnus-message-buffer (current-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
244 (set (make-local-variable 'gnus-message-group-art) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
245 (cons ,group ,article)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
246 (set (make-local-variable 'gnus-newsgroup-name) ,group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
247 (gnus-run-hooks 'gnus-message-setup-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
248 (if (eq major-mode 'message-mode) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
249 ;; Make mml-buffer-list local. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
250 ;; Restore global mml-buffer-list value as mbl. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
251 ;; What a hack! -- Shenghuo |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
252 (let ((mml-buffer-list mml-buffer-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
253 (setq mml-buffer-list mbl) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
254 (make-local-variable 'mml-buffer-list) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
255 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
256 (mml-destroy-buffers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
257 (setq mml-buffer-list mbl))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
258 (gnus-add-buffer) |
17493 | 259 (gnus-configure-windows ,config t) |
260 (set-buffer-modified-p nil)))) | |
261 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
262 (defun gnus-setup-posting-charset (group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
263 (let ((alist gnus-group-posting-charset-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
264 (group (or group "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
265 elem) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
266 (when group |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
267 (catch 'found |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
268 (while (setq elem (pop alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
269 (when (or (and (stringp (car elem)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
270 (string-match (car elem) group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
271 (and (gnus-functionp (car elem)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
272 (funcall (car elem) group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
273 (and (symbolp (car elem)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
274 (symbol-value (car elem)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
275 (throw 'found (cons (cadr elem) (caddr elem))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
276 |
17493 | 277 (defun gnus-inews-add-send-actions (winconf buffer article) |
278 (make-local-hook 'message-sent-hook) | |
279 (add-hook 'message-sent-hook 'gnus-inews-do-gcc nil t) | |
280 (setq message-post-method | |
281 `(lambda (arg) | |
282 (gnus-post-method arg ,gnus-newsgroup-name))) | |
283 (setq message-newsreader (setq message-mailer (gnus-extended-version))) | |
284 (message-add-action | |
285 `(set-window-configuration ,winconf) 'exit 'postpone 'kill) | |
286 (message-add-action | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
287 `(when (gnus-buffer-exists-p ,buffer) |
17493 | 288 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
289 (set-buffer ,buffer) |
17493 | 290 ,(when article |
291 `(gnus-summary-mark-article-as-replied ,article)))) | |
292 'send)) | |
293 | |
294 (put 'gnus-setup-message 'lisp-indent-function 1) | |
295 (put 'gnus-setup-message 'edebug-form-spec '(form body)) | |
296 | |
297 ;;; Post news commands of Gnus group mode and summary mode | |
298 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
299 (defun gnus-group-mail (&optional arg) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
300 "Start composing a mail. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
301 If ARG, use the group under the point to find a posting style. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
302 If ARG is 1, prompt for a group name to find the posting style." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
303 (interactive "P") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
304 ;; We can't `let' gnus-newsgroup-name here, since that leads |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
305 ;; to local variables leaking. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
306 (let ((group gnus-newsgroup-name) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
307 (buffer (current-buffer))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
308 (unwind-protect |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
309 (progn |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
310 (setq gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
311 (if arg |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
312 (if (= 1 (prefix-numeric-value arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
313 (completing-read "Use posting style of group: " |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
314 gnus-active-hashtb nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
315 (gnus-read-active-file-p)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
316 (gnus-group-group-name)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
317 "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
318 (gnus-setup-message 'message (message-mail))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
319 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
320 (set-buffer buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
321 (setq gnus-newsgroup-name group))))) |
17493 | 322 |
323 (defun gnus-group-post-news (&optional arg) | |
324 "Start composing a news message. | |
325 If ARG, post to the group under point. | |
326 If ARG is 1, prompt for a group name." | |
327 (interactive "P") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
328 ;; Bind this variable here to make message mode hooks work ok. |
17493 | 329 (let ((gnus-newsgroup-name |
330 (if arg | |
331 (if (= 1 (prefix-numeric-value arg)) | |
332 (completing-read "Newsgroup: " gnus-active-hashtb nil | |
333 (gnus-read-active-file-p)) | |
334 (gnus-group-group-name)) | |
335 ""))) | |
336 (gnus-post-news 'post gnus-newsgroup-name))) | |
337 | |
338 (defun gnus-summary-post-news () | |
339 "Start composing a news message." | |
340 (interactive) | |
341 (gnus-post-news 'post gnus-newsgroup-name)) | |
342 | |
343 (defun gnus-summary-followup (yank &optional force-news) | |
344 "Compose a followup to an article. | |
345 If prefix argument YANK is non-nil, original article is yanked automatically." | |
346 (interactive | |
347 (list (and current-prefix-arg | |
348 (gnus-summary-work-articles 1)))) | |
349 (when yank | |
350 (gnus-summary-goto-subject (car yank))) | |
351 (save-window-excursion | |
352 (gnus-summary-select-article)) | |
353 (let ((headers (gnus-summary-article-header (gnus-summary-article-number))) | |
354 (gnus-newsgroup-name gnus-newsgroup-name)) | |
355 ;; Send a followup. | |
356 (gnus-post-news nil gnus-newsgroup-name | |
357 headers gnus-article-buffer | |
358 yank nil force-news))) | |
359 | |
360 (defun gnus-summary-followup-with-original (n &optional force-news) | |
361 "Compose a followup to an article and include the original article." | |
362 (interactive "P") | |
363 (gnus-summary-followup (gnus-summary-work-articles n) force-news)) | |
364 | |
365 (defun gnus-summary-followup-to-mail (&optional arg) | |
366 "Followup to the current mail message via news." | |
367 (interactive | |
368 (list (and current-prefix-arg | |
369 (gnus-summary-work-articles 1)))) | |
370 (gnus-summary-followup arg t)) | |
371 | |
372 (defun gnus-summary-followup-to-mail-with-original (&optional arg) | |
373 "Followup to the current mail message via news." | |
374 (interactive "P") | |
375 (gnus-summary-followup (gnus-summary-work-articles arg) t)) | |
376 | |
377 (defun gnus-inews-yank-articles (articles) | |
378 (let (beg article) | |
379 (message-goto-body) | |
380 (while (setq article (pop articles)) | |
381 (save-window-excursion | |
382 (set-buffer gnus-summary-buffer) | |
383 (gnus-summary-select-article nil nil nil article) | |
384 (gnus-summary-remove-process-mark article)) | |
385 (gnus-copy-article-buffer) | |
386 (let ((message-reply-buffer gnus-article-copy) | |
387 (message-reply-headers gnus-current-headers)) | |
388 (message-yank-original) | |
389 (setq beg (or beg (mark t)))) | |
390 (when articles | |
391 (insert "\n"))) | |
392 (push-mark) | |
393 (goto-char beg))) | |
394 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
395 (defun gnus-summary-cancel-article (&optional n symp) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
396 "Cancel an article you posted. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
397 Uses the process-prefix convention. If given the symbolic |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
398 prefix `a', cancel using the standard posting method; if not |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
399 post using the current select method." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
400 (interactive (gnus-interactive "P\ny")) |
17493 | 401 (let ((articles (gnus-summary-work-articles n)) |
402 (message-post-method | |
403 `(lambda (arg) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
404 (gnus-post-method (not (eq symp 'a)) ,gnus-newsgroup-name))) |
17493 | 405 article) |
406 (while (setq article (pop articles)) | |
407 (when (gnus-summary-select-article t nil nil article) | |
408 (when (gnus-eval-in-buffer-window gnus-original-article-buffer | |
409 (message-cancel-news)) | |
410 (gnus-summary-mark-as-read article gnus-canceled-mark) | |
411 (gnus-cache-remove-article 1)) | |
412 (gnus-article-hide-headers-if-wanted)) | |
413 (gnus-summary-remove-process-mark article)))) | |
414 | |
415 (defun gnus-summary-supersede-article () | |
416 "Compose an article that will supersede a previous article. | |
417 This is done simply by taking the old article and adding a Supersedes | |
418 header line with the old Message-ID." | |
419 (interactive) | |
420 (let ((article (gnus-summary-article-number))) | |
421 (gnus-setup-message 'reply-yank | |
422 (gnus-summary-select-article t) | |
423 (set-buffer gnus-original-article-buffer) | |
424 (message-supersede) | |
425 (push | |
426 `((lambda () | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
427 (when (gnus-buffer-exists-p ,gnus-summary-buffer) |
17493 | 428 (save-excursion |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
429 (set-buffer ,gnus-summary-buffer) |
17493 | 430 (gnus-cache-possibly-remove-article ,article nil nil nil t) |
431 (gnus-summary-mark-as-read ,article gnus-canceled-mark))))) | |
432 message-send-actions)))) | |
433 | |
434 | |
435 | |
436 (defun gnus-copy-article-buffer (&optional article-buffer) | |
437 ;; make a copy of the article buffer with all text properties removed | |
438 ;; this copy is in the buffer gnus-article-copy. | |
439 ;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used | |
440 ;; this buffer should be passed to all mail/news reply/post routines. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
441 (setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
442 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
443 (set-buffer gnus-article-copy) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
444 (mm-enable-multibyte)) |
17493 | 445 (let ((article-buffer (or article-buffer gnus-article-buffer)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
446 end beg) |
17493 | 447 (if (not (and (get-buffer article-buffer) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
448 (gnus-buffer-exists-p article-buffer))) |
17493 | 449 (error "Can't find any article buffer") |
450 (save-excursion | |
451 (set-buffer article-buffer) | |
452 (save-restriction | |
453 ;; Copy over the (displayed) article buffer, delete | |
454 ;; hidden text and remove text properties. | |
455 (widen) | |
456 (copy-to-buffer gnus-article-copy (point-min) (point-max)) | |
457 (set-buffer gnus-article-copy) | |
458 (gnus-article-delete-text-of-type 'annotation) | |
459 (gnus-remove-text-with-property 'gnus-prev) | |
460 (gnus-remove-text-with-property 'gnus-next) | |
461 (insert | |
462 (prog1 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
463 (buffer-substring-no-properties (point-min) (point-max)) |
17493 | 464 (erase-buffer))) |
465 ;; Find the original headers. | |
466 (set-buffer gnus-original-article-buffer) | |
467 (goto-char (point-min)) | |
468 (while (looking-at message-unix-mail-delimiter) | |
469 (forward-line 1)) | |
470 (setq beg (point)) | |
471 (setq end (or (search-forward "\n\n" nil t) (point))) | |
472 ;; Delete the headers from the displayed articles. | |
473 (set-buffer gnus-article-copy) | |
474 (delete-region (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
475 (or (search-forward "\n\n" nil t) (point-max))) |
17493 | 476 ;; Insert the original article headers. |
477 (insert-buffer-substring gnus-original-article-buffer beg end) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
478 (article-decode-encoded-words))) |
17493 | 479 gnus-article-copy))) |
480 | |
481 (defun gnus-post-news (post &optional group header article-buffer yank subject | |
482 force-news) | |
483 (when article-buffer | |
484 (gnus-copy-article-buffer)) | |
485 (let ((gnus-article-reply article-buffer) | |
486 (add-to-list gnus-add-to-list)) | |
487 (gnus-setup-message (cond (yank 'reply-yank) | |
488 (article-buffer 'reply) | |
489 (t 'message)) | |
490 (let* ((group (or group gnus-newsgroup-name)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
491 (charset (gnus-group-name-charset nil group)) |
17493 | 492 (pgroup group) |
493 to-address to-group mailing-list to-list | |
494 newsgroup-p) | |
495 (when group | |
496 (setq to-address (gnus-group-find-parameter group 'to-address) | |
497 to-group (gnus-group-find-parameter group 'to-group) | |
498 to-list (gnus-group-find-parameter group 'to-list) | |
499 newsgroup-p (gnus-group-find-parameter group 'newsgroup) | |
500 mailing-list (when gnus-mailing-list-groups | |
501 (string-match gnus-mailing-list-groups group)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
502 group (gnus-group-name-decode (gnus-group-real-name group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
503 charset))) |
17493 | 504 (if (or (and to-group |
505 (gnus-news-group-p to-group)) | |
506 newsgroup-p | |
507 force-news | |
508 (and (gnus-news-group-p | |
509 (or pgroup gnus-newsgroup-name) | |
510 (if header (mail-header-number header) | |
511 gnus-current-article)) | |
512 (not mailing-list) | |
513 (not to-list) | |
514 (not to-address))) | |
515 ;; This is news. | |
516 (if post | |
517 (message-news (or to-group group)) | |
518 (set-buffer gnus-article-copy) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
519 (gnus-msg-treat-broken-reply-to) |
17493 | 520 (message-followup (if (or newsgroup-p force-news) nil to-group))) |
521 ;; The is mail. | |
522 (if post | |
523 (progn | |
524 (message-mail (or to-address to-list)) | |
525 ;; Arrange for mail groups that have no `to-address' to | |
526 ;; get that when the user sends off the mail. | |
527 (when (and (not to-list) | |
528 (not to-address) | |
529 add-to-list) | |
530 (push (list 'gnus-inews-add-to-address pgroup) | |
531 message-send-actions))) | |
532 (set-buffer gnus-article-copy) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
533 (gnus-msg-treat-broken-reply-to) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
534 (message-wide-reply to-address))) |
17493 | 535 (when yank |
536 (gnus-inews-yank-articles yank)))))) | |
537 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
538 (defun gnus-msg-treat-broken-reply-to () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
539 "Remove the Reply-to header iff broken-reply-to." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
540 (when (gnus-group-find-parameter |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
541 gnus-newsgroup-name 'broken-reply-to) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
542 (save-restriction |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
543 (message-narrow-to-head) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
544 (message-remove-header "reply-to")))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
545 |
17493 | 546 (defun gnus-post-method (arg group &optional silent) |
547 "Return the posting method based on GROUP and ARG. | |
548 If SILENT, don't prompt the user." | |
549 (let ((group-method (gnus-find-method-for-group group))) | |
550 (cond | |
551 ;; If the group-method is nil (which shouldn't happen) we use | |
552 ;; the default method. | |
553 ((null group-method) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
554 (or (and (null (eq gnus-post-method 'active)) gnus-post-method) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
555 gnus-select-method message-post-method)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
556 ;; We want the inverse of the default |
17493 | 557 ((and arg (not (eq arg 0))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
558 (if (eq gnus-post-method 'active) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
559 gnus-select-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
560 group-method)) |
17493 | 561 ;; We query the user for a post method. |
562 ((or arg | |
563 (and gnus-post-method | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
564 (not (eq gnus-post-method 'current)) |
17493 | 565 (listp (car gnus-post-method)))) |
566 (let* ((methods | |
567 ;; Collect all methods we know about. | |
568 (append | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
569 (when (and gnus-post-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
570 (not (eq gnus-post-method 'current))) |
17493 | 571 (if (listp (car gnus-post-method)) |
572 gnus-post-method | |
573 (list gnus-post-method))) | |
574 gnus-secondary-select-methods | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
575 (mapcar 'cdr gnus-server-alist) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
576 (mapcar 'car gnus-opened-servers) |
17493 | 577 (list gnus-select-method) |
578 (list group-method))) | |
579 method-alist post-methods method) | |
580 ;; Weed out all mail methods. | |
581 (while methods | |
582 (setq method (gnus-server-get-method "" (pop methods))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
583 (when (and (or (gnus-method-option-p method 'post) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
584 (gnus-method-option-p method 'post-mail)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
585 (not (member method post-methods))) |
17493 | 586 (push method post-methods))) |
587 ;; Create a name-method alist. | |
588 (setq method-alist | |
589 (mapcar | |
590 (lambda (m) | |
591 (list (concat (cadr m) " (" (symbol-name (car m)) ")") m)) | |
592 post-methods)) | |
593 ;; Query the user. | |
594 (cadr | |
595 (assoc | |
596 (setq gnus-last-posting-server | |
597 (if (and silent | |
598 gnus-last-posting-server) | |
599 ;; Just use the last value. | |
600 gnus-last-posting-server | |
601 (completing-read | |
602 "Posting method: " method-alist nil t | |
603 (cons (or gnus-last-posting-server "") 0)))) | |
604 method-alist)))) | |
605 ;; Override normal method. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
606 ((and (eq gnus-post-method 'current) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
607 (not (eq (car group-method) 'nndraft)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
608 (gnus-get-function group-method 'request-post t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
609 (not arg)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
610 group-method) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
611 ((and gnus-post-method |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
612 (not (eq gnus-post-method 'current))) |
17493 | 613 gnus-post-method) |
614 ;; Use the normal select method. | |
615 (t gnus-select-method)))) | |
616 | |
617 | |
618 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
619 ;; Dummies to avoid byte-compile warning. |
17493 | 620 (defvar nnspool-rejected-article-hook) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19531
diff
changeset
|
621 (defvar xemacs-codename) |
17493 | 622 |
623 (defun gnus-extended-version () | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
624 "Stringified Gnus version and Emacs version." |
17493 | 625 (interactive) |
626 (concat | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
627 "Gnus/" (prin1-to-string (gnus-continuum-version gnus-version) t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
628 " (" gnus-version ")" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
629 " " |
17493 | 630 (cond |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
631 ((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
632 (concat "Emacs/" (match-string 1 emacs-version))) |
17493 | 633 ((string-match "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?" |
634 emacs-version) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
635 (concat (match-string 1 emacs-version) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
636 (format "/%d.%d" emacs-major-version emacs-minor-version) |
17493 | 637 (if (match-beginning 3) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
638 (match-string 3 emacs-version) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19531
diff
changeset
|
639 "") |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19531
diff
changeset
|
640 (if (boundp 'xemacs-codename) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
641 (concat " (" xemacs-codename ")") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
642 ""))) |
17493 | 643 (t emacs-version)))) |
644 | |
645 | |
646 ;;; | |
647 ;;; Gnus Mail Functions | |
648 ;;; | |
649 | |
650 ;;; Mail reply commands of Gnus summary mode | |
651 | |
652 (defun gnus-summary-reply (&optional yank wide) | |
653 "Start composing a reply mail to the current message. | |
654 If prefix argument YANK is non-nil, the original article is yanked | |
655 automatically." | |
656 (interactive | |
657 (list (and current-prefix-arg | |
658 (gnus-summary-work-articles 1)))) | |
659 ;; Stripping headers should be specified with mail-yank-ignored-headers. | |
660 (when yank | |
661 (gnus-summary-goto-subject (car yank))) | |
662 (let ((gnus-article-reply t)) | |
663 (gnus-setup-message (if yank 'reply-yank 'reply) | |
664 (gnus-summary-select-article) | |
665 (set-buffer (gnus-copy-article-buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
666 (gnus-msg-treat-broken-reply-to) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
667 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
668 (message-narrow-to-head) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
669 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
670 (mml-quote-region (point) (point-max)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
671 (message-reply nil wide) |
17493 | 672 (when yank |
673 (gnus-inews-yank-articles yank))))) | |
674 | |
675 (defun gnus-summary-reply-with-original (n &optional wide) | |
676 "Start composing a reply mail to the current message. | |
677 The original article will be yanked." | |
678 (interactive "P") | |
679 (gnus-summary-reply (gnus-summary-work-articles n) wide)) | |
680 | |
681 (defun gnus-summary-wide-reply (&optional yank) | |
682 "Start composing a wide reply mail to the current message. | |
683 If prefix argument YANK is non-nil, the original article is yanked | |
684 automatically." | |
685 (interactive | |
686 (list (and current-prefix-arg | |
687 (gnus-summary-work-articles 1)))) | |
688 (gnus-summary-reply yank t)) | |
689 | |
690 (defun gnus-summary-wide-reply-with-original (n) | |
691 "Start composing a wide reply mail to the current message. | |
692 The original article will be yanked." | |
693 (interactive "P") | |
694 (gnus-summary-reply-with-original n t)) | |
695 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
696 (defun gnus-summary-mail-forward (&optional arg post) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
697 "Forward the current message to another user. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
698 If ARG is nil, see `message-forward-as-mime' and `message-forward-show-mml'; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
699 if ARG is 1, decode the message and forward directly inline; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
700 if ARG is 2, foward message as an rfc822 MIME section; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
701 if ARG is 3, decode message and forward as an rfc822 MIME section; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
702 if ARG is 4, foward message directly inline; |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
703 otherwise, use flipped `message-forward-as-mime'. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
704 If POST, post instead of mail." |
17493 | 705 (interactive "P") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
706 (let ((message-forward-as-mime message-forward-as-mime) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
707 (message-forward-show-mml message-forward-show-mml)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
708 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
709 ((null arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
710 ((eq arg 1) (setq message-forward-as-mime nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
711 message-forward-show-mml t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
712 ((eq arg 2) (setq message-forward-as-mime t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
713 message-forward-show-mml nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
714 ((eq arg 3) (setq message-forward-as-mime t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
715 message-forward-show-mml t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
716 ((eq arg 4) (setq message-forward-as-mime nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
717 message-forward-show-mml nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
718 (t (setq message-forward-as-mime (not message-forward-as-mime)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
719 (gnus-setup-message 'forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
720 (gnus-summary-select-article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
721 (let ((mail-parse-charset gnus-newsgroup-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
722 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
723 text) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
724 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
725 (set-buffer gnus-original-article-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
726 (mm-with-unibyte-current-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
727 (setq text (buffer-string)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
728 (set-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
729 (gnus-get-buffer-create |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
730 (generate-new-buffer-name " *Gnus forward*"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
731 (erase-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
732 (mm-disable-multibyte) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
733 (insert text) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
734 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
735 (when (looking-at "From ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
736 (replace-match "X-From-Line: ") ) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
737 (when message-forward-show-mml |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
738 (mm-enable-multibyte) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
739 (mime-to-mml)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
740 (message-forward post))))) |
17493 | 741 |
742 (defun gnus-summary-resend-message (address n) | |
743 "Resend the current article to ADDRESS." | |
744 (interactive "sResend message(s) to: \nP") | |
745 (let ((articles (gnus-summary-work-articles n)) | |
746 article) | |
747 (while (setq article (pop articles)) | |
748 (gnus-summary-select-article nil nil nil article) | |
749 (save-excursion | |
750 (set-buffer gnus-original-article-buffer) | |
751 (message-resend address))))) | |
752 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
753 (defun gnus-summary-post-forward (&optional arg) |
17493 | 754 "Forward the current article to a newsgroup. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
755 See `gnus-summary-mail-forward' for ARG." |
17493 | 756 (interactive "P") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
757 (gnus-summary-mail-forward arg t)) |
17493 | 758 |
759 (defvar gnus-nastygram-message | |
760 "The following article was inappropriately posted to %s.\n\n" | |
761 "Format string to insert in nastygrams. | |
762 The current group name will be inserted at \"%s\".") | |
763 | |
764 (defun gnus-summary-mail-nastygram (n) | |
765 "Send a nastygram to the author of the current article." | |
766 (interactive "P") | |
767 (when (or gnus-expert-user | |
768 (gnus-y-or-n-p | |
769 "Really send a nastygram to the author of the current article? ")) | |
770 (let ((group gnus-newsgroup-name)) | |
771 (gnus-summary-reply-with-original n) | |
772 (set-buffer gnus-message-buffer) | |
773 (message-goto-body) | |
774 (insert (format gnus-nastygram-message group)) | |
775 (message-send-and-exit)))) | |
776 | |
777 (defun gnus-summary-mail-crosspost-complaint (n) | |
778 "Send a complaint about crossposting to the current article(s)." | |
779 (interactive "P") | |
780 (let ((articles (gnus-summary-work-articles n)) | |
781 article) | |
782 (while (setq article (pop articles)) | |
783 (set-buffer gnus-summary-buffer) | |
784 (gnus-summary-goto-subject article) | |
785 (let ((group (gnus-group-real-name gnus-newsgroup-name)) | |
786 newsgroups followup-to) | |
787 (gnus-summary-select-article) | |
788 (set-buffer gnus-original-article-buffer) | |
789 (if (and (<= (length (message-tokenize-header | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
790 (setq newsgroups |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
791 (mail-fetch-field "newsgroups")) |
17493 | 792 ", ")) |
793 1) | |
794 (or (not (setq followup-to (mail-fetch-field "followup-to"))) | |
795 (not (member group (message-tokenize-header | |
796 followup-to ", "))))) | |
797 (if followup-to | |
798 (gnus-message 1 "Followup-to restricted") | |
799 (gnus-message 1 "Not a crossposted article")) | |
800 (set-buffer gnus-summary-buffer) | |
801 (gnus-summary-reply-with-original 1) | |
802 (set-buffer gnus-message-buffer) | |
803 (message-goto-body) | |
804 (insert (format gnus-crosspost-complaint newsgroups group)) | |
805 (message-goto-subject) | |
806 (re-search-forward " *$") | |
807 (replace-match " (crosspost notification)" t t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
808 (gnus-deactivate-mark) |
17493 | 809 (when (gnus-y-or-n-p "Send this complaint? ") |
810 (message-send-and-exit))))))) | |
811 | |
812 (defun gnus-summary-mail-other-window () | |
813 "Compose mail in other window." | |
814 (interactive) | |
815 (gnus-setup-message 'message | |
816 (message-mail))) | |
817 | |
818 (defun gnus-mail-parse-comma-list () | |
819 (let (accumulated | |
820 beg) | |
821 (skip-chars-forward " ") | |
822 (while (not (eobp)) | |
823 (setq beg (point)) | |
824 (skip-chars-forward "^,") | |
825 (while (zerop | |
826 (save-excursion | |
827 (save-restriction | |
828 (let ((i 0)) | |
829 (narrow-to-region beg (point)) | |
830 (goto-char beg) | |
831 (logand (progn | |
832 (while (search-forward "\"" nil t) | |
833 (incf i)) | |
834 (if (zerop i) 2 i)) | |
835 2))))) | |
836 (skip-chars-forward ",") | |
837 (skip-chars-forward "^,")) | |
838 (skip-chars-backward " ") | |
839 (push (buffer-substring beg (point)) | |
840 accumulated) | |
841 (skip-chars-forward "^,") | |
842 (skip-chars-forward ", ")) | |
843 accumulated)) | |
844 | |
845 (defun gnus-inews-add-to-address (group) | |
846 (let ((to-address (mail-fetch-field "to"))) | |
847 (when (and to-address | |
848 (gnus-alive-p)) | |
849 ;; This mail group doesn't have a `to-list', so we add one | |
850 ;; here. Magic! | |
851 (when (gnus-y-or-n-p | |
852 (format "Do you want to add this as `to-list': %s " to-address)) | |
853 (gnus-group-add-parameter group (cons 'to-list to-address)))))) | |
854 | |
855 (defun gnus-put-message () | |
856 "Put the current message in some group and return to Gnus." | |
857 (interactive) | |
858 (let ((reply gnus-article-reply) | |
859 (winconf gnus-prev-winconf) | |
860 (group gnus-newsgroup-name)) | |
861 | |
862 (or (and group (not (gnus-group-read-only-p group))) | |
863 (setq group (read-string "Put in group: " nil | |
864 (gnus-writable-groups)))) | |
865 (when (gnus-gethash group gnus-newsrc-hashtb) | |
866 (error "No such group: %s" group)) | |
867 | |
868 (save-excursion | |
869 (save-restriction | |
870 (widen) | |
871 (message-narrow-to-headers) | |
872 (let (gnus-deletable-headers) | |
873 (if (message-news-p) | |
874 (message-generate-headers message-required-news-headers) | |
875 (message-generate-headers message-required-mail-headers))) | |
876 (goto-char (point-max)) | |
877 (insert "Gcc: " group "\n") | |
878 (widen))) | |
879 | |
880 (gnus-inews-do-gcc) | |
881 | |
882 (when (get-buffer gnus-group-buffer) | |
883 (when (gnus-buffer-exists-p (car-safe reply)) | |
884 (set-buffer (car reply)) | |
885 (and (cdr reply) | |
886 (gnus-summary-mark-article-as-replied | |
887 (cdr reply)))) | |
888 (when winconf | |
889 (set-window-configuration winconf))))) | |
890 | |
891 (defun gnus-article-mail (yank) | |
892 "Send a reply to the address near point. | |
893 If YANK is non-nil, include the original article." | |
894 (interactive "P") | |
895 (let ((address | |
896 (buffer-substring | |
897 (save-excursion (re-search-backward "[ \t\n]" nil t) (1+ (point))) | |
898 (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point)))))) | |
899 (when address | |
900 (message-reply address) | |
901 (when yank | |
902 (gnus-inews-yank-articles (list (cdr gnus-article-current))))))) | |
903 | |
904 (defvar nntp-server-type) | |
905 (defun gnus-bug () | |
906 "Send a bug report to the Gnus maintainers." | |
907 (interactive) | |
908 (unless (gnus-alive-p) | |
909 (error "Gnus has been shut down")) | |
910 (gnus-setup-message 'bug | |
911 (delete-other-windows) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
912 (when gnus-bug-create-help-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
913 (switch-to-buffer "*Gnus Help Bug*") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
914 (erase-buffer) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
915 (insert gnus-bug-message) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
916 (goto-char (point-min))) |
17493 | 917 (message-pop-to-buffer "*Gnus Bug*") |
918 (message-setup `((To . ,gnus-maintainer) (Subject . ""))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
919 (when gnus-bug-create-help-buffer |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
920 (push `(gnus-bug-kill-buffer) message-send-actions)) |
17493 | 921 (goto-char (point-min)) |
922 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")) | |
923 (forward-line 1) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
924 (insert (gnus-version) "\n" |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
925 (emacs-version) "\n") |
17493 | 926 (when (and (boundp 'nntp-server-type) |
927 (stringp nntp-server-type)) | |
928 (insert nntp-server-type)) | |
929 (insert "\n\n\n\n\n") | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
930 (let (text) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
931 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
932 (set-buffer (gnus-get-buffer-create " *gnus environment info*")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
933 (gnus-debug) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
934 (setq text (buffer-string))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
935 (insert "<#part type=application/x-emacs-lisp disposition=inline description=\"User settings\">\n" text "\n<#/part>")) |
17493 | 936 (goto-char (point-min)) |
937 (search-forward "Subject: " nil t) | |
938 (message ""))) | |
939 | |
940 (defun gnus-bug-kill-buffer () | |
941 (when (get-buffer "*Gnus Help Bug*") | |
942 (kill-buffer "*Gnus Help Bug*"))) | |
943 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
944 (defun gnus-summary-yank-message (buffer n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
945 "Yank the current article into a composed message." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
946 (interactive |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
947 (list (completing-read "Buffer: " (mapcar 'list (message-buffers)) nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
948 current-prefix-arg)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
949 (gnus-summary-iterate n |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
950 (let ((gnus-display-mime-function nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
951 (gnus-inhibit-treatment t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
952 (gnus-summary-select-article)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
953 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
954 (set-buffer buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
955 (message-yank-buffer gnus-article-buffer)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
956 |
17493 | 957 (defun gnus-debug () |
958 "Attempts to go through the Gnus source file and report what variables have been changed. | |
959 The source file has to be in the Emacs load path." | |
960 (interactive) | |
961 (let ((files '("gnus.el" "gnus-sum.el" "gnus-group.el" | |
962 "gnus-art.el" "gnus-start.el" "gnus-async.el" | |
963 "gnus-msg.el" "gnus-score.el" "gnus-win.el" "gnus-topic.el" | |
964 "nnmail.el" "message.el")) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
965 (point (point)) |
17493 | 966 file expr olist sym) |
967 (gnus-message 4 "Please wait while we snoop your variables...") | |
968 (sit-for 0) | |
969 ;; Go through all the files looking for non-default values for variables. | |
970 (save-excursion | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
971 (set-buffer (gnus-get-buffer-create " *gnus bug info*")) |
17493 | 972 (while files |
973 (erase-buffer) | |
974 (when (and (setq file (locate-library (pop files))) | |
975 (file-exists-p file)) | |
976 (insert-file-contents file) | |
977 (goto-char (point-min)) | |
978 (if (not (re-search-forward "^;;* *Internal variables" nil t)) | |
979 (gnus-message 4 "Malformed sources in file %s" file) | |
980 (narrow-to-region (point-min) (point)) | |
981 (goto-char (point-min)) | |
982 (while (setq expr (ignore-errors (read (current-buffer)))) | |
983 (ignore-errors | |
984 (and (or (eq (car expr) 'defvar) | |
985 (eq (car expr) 'defcustom)) | |
986 (stringp (nth 3 expr)) | |
987 (or (not (boundp (nth 1 expr))) | |
988 (not (equal (eval (nth 2 expr)) | |
989 (symbol-value (nth 1 expr))))) | |
990 (push (nth 1 expr) olist))))))) | |
991 (kill-buffer (current-buffer))) | |
992 (when (setq olist (nreverse olist)) | |
993 (insert "------------------ Environment follows ------------------\n\n")) | |
994 (while olist | |
995 (if (boundp (car olist)) | |
996 (condition-case () | |
997 (pp `(setq ,(car olist) | |
998 ,(if (or (consp (setq sym (symbol-value (car olist)))) | |
999 (and (symbolp sym) | |
1000 (not (or (eq sym nil) | |
1001 (eq sym t))))) | |
1002 (list 'quote (symbol-value (car olist))) | |
1003 (symbol-value (car olist)))) | |
1004 (current-buffer)) | |
1005 (error | |
1006 (format "(setq %s 'whatever)\n" (car olist)))) | |
1007 (insert ";; (makeunbound '" (symbol-name (car olist)) ")\n")) | |
1008 (setq olist (cdr olist))) | |
1009 (insert "\n\n") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1010 ;; Remove any control chars - they seem to cause trouble for some |
17493 | 1011 ;; mailers. (Byte-compiled output from the stuff above.) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1012 (goto-char point) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1013 (while (re-search-forward "[\000-\010\013-\037\200-\237]" nil t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1014 (replace-match (format "\\%03o" (string-to-char (match-string 0))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1015 t t)))) |
17493 | 1016 |
1017 ;;; Treatment of rejected articles. | |
1018 ;;; Bounced mail. | |
1019 | |
1020 (defun gnus-summary-resend-bounced-mail (&optional fetch) | |
1021 "Re-mail the current message. | |
1022 This only makes sense if the current message is a bounce message than | |
1023 contains some mail you have written which has been bounced back to | |
1024 you. | |
1025 If FETCH, try to fetch the article that this is a reply to, if indeed | |
1026 this is a reply." | |
1027 (interactive "P") | |
1028 (gnus-summary-select-article t) | |
1029 (set-buffer gnus-original-article-buffer) | |
1030 (gnus-setup-message 'compose-bounce | |
1031 (let* ((references (mail-fetch-field "references")) | |
1032 (parent (and references (gnus-parent-id references)))) | |
1033 (message-bounce) | |
1034 ;; If there are references, we fetch the article we answered to. | |
1035 (and fetch parent | |
1036 (gnus-summary-refer-article parent) | |
1037 (gnus-summary-show-all-headers))))) | |
1038 | |
1039 ;;; Gcc handling. | |
1040 | |
1041 ;; Do Gcc handling, which copied the message over to some group. | |
1042 (defun gnus-inews-do-gcc (&optional gcc) | |
1043 (interactive) | |
1044 (when (gnus-alive-p) | |
1045 (save-excursion | |
1046 (save-restriction | |
1047 (message-narrow-to-headers) | |
1048 (let ((gcc (or gcc (mail-fetch-field "gcc" nil t))) | |
1049 (cur (current-buffer)) | |
1050 groups group method) | |
1051 (when gcc | |
1052 (message-remove-header "gcc") | |
1053 (widen) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1054 (setq groups (message-unquote-tokens |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1055 (message-tokenize-header gcc " ,"))) |
17493 | 1056 ;; Copy the article over to some group(s). |
1057 (while (setq group (pop groups)) | |
1058 (gnus-check-server | |
1059 (setq method | |
1060 (cond ((and (null (gnus-get-info group)) | |
1061 (eq (car gnus-message-archive-method) | |
1062 (car | |
1063 (gnus-server-to-method | |
1064 (gnus-group-method group))))) | |
1065 ;; If the group doesn't exist, we assume | |
1066 ;; it's an archive group... | |
1067 gnus-message-archive-method) | |
1068 ;; Use the method. | |
1069 ((gnus-info-method (gnus-get-info group)) | |
1070 (gnus-info-method (gnus-get-info group))) | |
1071 ;; Find the method. | |
1072 (t (gnus-group-method group))))) | |
1073 (gnus-check-server method) | |
1074 (unless (gnus-request-group group t method) | |
1075 (gnus-request-create-group group method)) | |
1076 (save-excursion | |
1077 (nnheader-set-temp-buffer " *acc*") | |
1078 (insert-buffer-substring cur) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1079 (message-encode-message-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1080 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1081 (message-narrow-to-headers) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1082 (let ((mail-parse-charset message-default-charset) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1083 (rfc2047-header-encoding-alist |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1084 (cons '("Newsgroups" . default) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1085 rfc2047-header-encoding-alist))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1086 (mail-encode-encoded-word-buffer))) |
17493 | 1087 (goto-char (point-min)) |
1088 (when (re-search-forward | |
1089 (concat "^" (regexp-quote mail-header-separator) "$") | |
1090 nil t) | |
1091 (replace-match "" t t )) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1092 (unless (gnus-request-accept-article group method t t) |
17493 | 1093 (gnus-message 1 "Couldn't store article in group %s: %s" |
1094 group (gnus-status-message method)) | |
1095 (sit-for 2)) | |
1096 (kill-buffer (current-buffer)))))))))) | |
1097 | |
1098 (defun gnus-inews-insert-gcc () | |
1099 "Insert Gcc headers based on `gnus-outgoing-message-group'." | |
1100 (save-excursion | |
1101 (save-restriction | |
1102 (message-narrow-to-headers) | |
1103 (let* ((group gnus-outgoing-message-group) | |
1104 (gcc (cond | |
1105 ((gnus-functionp group) | |
1106 (funcall group)) | |
1107 ((or (stringp group) (list group)) | |
1108 group)))) | |
1109 (when gcc | |
1110 (insert "Gcc: " | |
1111 (if (stringp gcc) gcc | |
1112 (mapconcat 'identity gcc " ")) | |
1113 "\n")))))) | |
1114 | |
1115 (defun gnus-inews-insert-archive-gcc (&optional group) | |
1116 "Insert the Gcc to say where the article is to be archived." | |
1117 (let* ((var gnus-message-archive-group) | |
1118 (group (or group gnus-newsgroup-name "")) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1119 (gcc-self-val |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1120 (and gnus-newsgroup-name |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1121 (not (equal gnus-newsgroup-name "")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1122 (gnus-group-find-parameter |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1123 gnus-newsgroup-name 'gcc-self))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1124 result |
17493 | 1125 (groups |
1126 (cond | |
1127 ((null gnus-message-archive-method) | |
1128 ;; Ignore. | |
1129 nil) | |
1130 ((stringp var) | |
1131 ;; Just a single group. | |
1132 (list var)) | |
1133 ((null var) | |
1134 ;; We don't want this. | |
1135 nil) | |
1136 ((and (listp var) (stringp (car var))) | |
1137 ;; A list of groups. | |
1138 var) | |
1139 ((gnus-functionp var) | |
1140 ;; A function. | |
1141 (funcall var group)) | |
1142 (t | |
1143 ;; An alist of regexps/functions/forms. | |
1144 (while (and var | |
1145 (not | |
1146 (setq result | |
1147 (cond | |
1148 ((stringp (caar var)) | |
1149 ;; Regexp. | |
1150 (when (string-match (caar var) group) | |
1151 (cdar var))) | |
1152 ((gnus-functionp (car var)) | |
1153 ;; Function. | |
1154 (funcall (car var) group)) | |
1155 (t | |
1156 (eval (car var))))))) | |
1157 (setq var (cdr var))) | |
1158 result))) | |
1159 name) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1160 (when (or groups gcc-self-val) |
17493 | 1161 (when (stringp groups) |
1162 (setq groups (list groups))) | |
1163 (save-excursion | |
1164 (save-restriction | |
1165 (message-narrow-to-headers) | |
1166 (goto-char (point-max)) | |
1167 (insert "Gcc: ") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1168 (if gcc-self-val |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1169 ;; Use the `gcc-self' param value instead. |
17493 | 1170 (progn |
1171 (insert | |
1172 (if (stringp gcc-self-val) | |
1173 gcc-self-val | |
1174 group)) | |
1175 (if (not (eq gcc-self-val 'none)) | |
1176 (insert "\n") | |
1177 (progn | |
1178 (beginning-of-line) | |
1179 (kill-line)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1180 ;; Use the list of groups. |
17493 | 1181 (while (setq name (pop groups)) |
1182 (insert (if (string-match ":" name) | |
1183 name | |
1184 (gnus-group-prefixed-name | |
1185 name gnus-message-archive-method))) | |
1186 (when groups | |
1187 (insert " "))) | |
1188 (insert "\n"))))))) | |
1189 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1190 ;;; Posting styles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1191 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1192 (defun gnus-configure-posting-styles () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1193 "Configure posting styles according to `gnus-posting-styles'." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1194 (unless gnus-inhibit-posting-styles |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1195 (let ((group (or gnus-newsgroup-name "")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1196 (styles gnus-posting-styles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1197 style match variable attribute value v results |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1198 filep name address element) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1199 ;; If the group has a posting-style parameter, add it at the end with a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1200 ;; regexp matching everything, to be sure it takes precedence over all |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1201 ;; the others. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1202 (when gnus-newsgroup-name |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1203 (let ((tmp-style (gnus-group-find-parameter group 'posting-style t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1204 (when tmp-style |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1205 (setq styles (append styles (list (cons ".*" tmp-style))))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1206 ;; Go through all styles and look for matches. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1207 (dolist (style styles) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1208 (setq match (pop style)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1209 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1210 (when (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1211 ((stringp match) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1212 ;; Regexp string match on the group name. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1213 (string-match match group)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1214 ((eq match 'header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1215 (let ((header (message-fetch-field (pop style)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1216 (and header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1217 (string-match (pop style) header)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1218 ((or (symbolp match) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1219 (gnus-functionp match)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1220 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1221 ((gnus-functionp match) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1222 ;; Function to be called. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1223 (funcall match)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1224 ((boundp match) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1225 ;; Variable to be checked. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1226 (symbol-value match)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1227 ((listp match) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1228 ;; This is a form to be evaled. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1229 (eval match))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
1230 ;; We have a match, so we set the variables. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1231 (dolist (attribute style) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1232 (setq element (pop attribute) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1233 variable nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1234 filep nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1235 (setq value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1236 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1237 ((eq (car attribute) :file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1238 (setq filep t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1239 (cadr attribute)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1240 ((eq (car attribute) :value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1241 (cadr attribute)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1242 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1243 (car attribute)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1244 ;; We get the value. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1245 (setq v |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1246 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1247 ((stringp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1248 value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1249 ((or (symbolp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1250 (gnus-functionp value)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1251 (cond ((gnus-functionp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1252 (funcall value)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1253 ((boundp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1254 (symbol-value value)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1255 ((listp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1256 (eval value)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1257 ;; Translate obsolescent value. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1258 (when (eq element 'signature-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1259 (setq element 'signature |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1260 filep t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1261 ;; Get the contents of file elems. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1262 (when (and filep v) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1263 (setq v (with-temp-buffer |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1264 (insert-file-contents v) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1265 (buffer-string)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1266 (setq results (delq (assoc element results) results)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1267 (push (cons element v) results)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1268 ;; Now we have all the styles, so we insert them. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1269 (setq name (assq 'name results) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1270 address (assq 'address results)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1271 (setq results (delq name (delq address results))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1272 (make-local-variable 'message-setup-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1273 (dolist (result results) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1274 (add-hook 'message-setup-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1275 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1276 ((eq 'eval (car result)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1277 'ignore) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1278 ((eq 'body (car result)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1279 `(lambda () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1280 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1281 (message-goto-body) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1282 (insert ,(cdr result))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1283 ((eq 'signature (car result)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1284 (set (make-local-variable 'message-signature) nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1285 (set (make-local-variable 'message-signature-file) nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1286 (if (not (cdr result)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1287 'ignore |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1288 `(lambda () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1289 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1290 (let ((message-signature ,(cdr result))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1291 (when message-signature |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1292 (message-insert-signature))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1293 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1294 (let ((header |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1295 (if (symbolp (car result)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1296 (capitalize (symbol-name (car result))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1297 (car result)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1298 `(lambda () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1299 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1300 (message-remove-header ,header) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1301 (let ((value ,(cdr result))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1302 (when value |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1303 (message-goto-eoh) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1304 (insert ,header ": " value "\n")))))))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1305 (when (or name address) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1306 (add-hook 'message-setup-hook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1307 `(lambda () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1308 (set (make-local-variable 'user-mail-address) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1309 ,(or (cdr address) user-mail-address)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1310 (let ((user-full-name ,(or (cdr name) (user-full-name))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1311 (user-mail-address |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1312 ,(or (cdr address) user-mail-address))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1313 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1314 (message-remove-header "From") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1315 (message-goto-eoh) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
1316 (insert "From: " (message-make-from) "\n"))))))))) |
17493 | 1317 |
1318 ;;; Allow redefinition of functions. | |
1319 | |
1320 (gnus-ems-redefine) | |
1321 | |
1322 (provide 'gnus-msg) | |
1323 | |
1324 ;;; gnus-msg.el ends here |