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