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