Mercurial > emacs
annotate lisp/gnus/nnmail.el @ 97408:7cf98fa4941b
(mh-variant-mh-info, mh-variant-nmh-info)
(mh-variant-set-variant, mh-variant-p, mh-profile-component)
(mh-variant-set, mh-variant, mh-scan-format-file): Fix typo in
docstring.
(mh-variant-info,mh-variant-mu-mh-info)
(mh-variant-p, mh-profile-component, mh-variant-set, mh-variant)
(mh-scan-format-file): Rename variant mu-mh to gnu-mh and be explicit
about GNU mailutils MH in docstrings (with thanks to Darel
Henman) (closes SF #1768928).
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Sun, 10 Aug 2008 23:12:40 +0000 |
parents | 645fb33380d6 |
children | be0cd2e19e84 |
rev | line source |
---|---|
17493 | 1 ;;; nnmail.el --- mail support functions for the Gnus mail backends |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
2 |
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, |
79708 | 4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news, mail |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17493 | 12 ;; it under the terms of the GNU General Public License as published by |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; (at your option) any later version. |
17493 | 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 | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17493 | 23 |
24 ;;; Commentary: | |
25 | |
26 ;;; Code: | |
27 | |
87232
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
28 ;; For Emacs < 22.2. |
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
29 (eval-and-compile |
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
30 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) |
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
31 |
19522
681265352f07
Require cl only at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
32 (eval-when-compile (require 'cl)) |
681265352f07
Require cl only at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
33 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
34 (require 'gnus) ; for macro gnus-kill-buffer, at least |
17493 | 35 (require 'nnheader) |
36 (require 'message) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
37 (require 'gnus-util) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
38 (require 'mail-source) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
39 (require 'mm-util) |
87232
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
40 (require 'gnus-int) |
17493 | 41 |
95820
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
42 (autoload 'gnus-add-buffer "gnus") |
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
43 (autoload 'gnus-kill-buffer "gnus") |
17493 | 44 |
45 (defgroup nnmail nil | |
46 "Reading mail with Gnus." | |
47 :group 'gnus) | |
48 | |
49 (defgroup nnmail-retrieve nil | |
50 "Retrieving new mail." | |
51 :group 'nnmail) | |
52 | |
53 (defgroup nnmail-prepare nil | |
63978
b76a00f5754f
(nnmail-prepare): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
62907
diff
changeset
|
54 "Preparing (or mangling) new mail after retrieval." |
17493 | 55 :group 'nnmail) |
56 | |
57 (defgroup nnmail-duplicate nil | |
58 "Handling of duplicate mail messages." | |
59 :group 'nnmail) | |
60 | |
61 (defgroup nnmail-split nil | |
48588 | 62 "Organizing the incoming mail in folders." |
17493 | 63 :group 'nnmail) |
64 | |
65 (defgroup nnmail-files nil | |
66 "Mail files." | |
67 :group 'gnus-files | |
68 :group 'nnmail) | |
69 | |
70 (defgroup nnmail-expire nil | |
71 "Expiring old mail." | |
72 :group 'nnmail) | |
73 | |
74 (defgroup nnmail-procmail nil | |
75 "Interfacing with procmail and other mail agents." | |
76 :group 'nnmail) | |
77 | |
78 (defgroup nnmail-various nil | |
79 "Various mail options." | |
80 :group 'nnmail) | |
81 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
82 (defcustom nnmail-split-methods '(("mail.misc" "")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
83 "*Incoming mail will be split according to this variable. |
17493 | 84 |
85 If you'd like, for instance, one mail group for mail from the | |
86 \"4ad-l\" mailing list, one group for junk mail and one for everything | |
87 else, you could do something like this: | |
88 | |
89 (setq nnmail-split-methods | |
90 '((\"mail.4ad\" \"From:.*4ad\") | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
91 (\"mail.junk\" \"From:.*Lars\\\\|Subject:.*buy\") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
92 (\"mail.misc\" \"\"))) |
17493 | 93 |
94 As you can see, this variable is a list of lists, where the first | |
95 element in each \"rule\" is the name of the group (which, by the way, | |
96 does not have to be called anything beginning with \"mail\", | |
97 \"yonka.zow\" is a fine, fine name), and the second is a regexp that | |
98 nnmail will try to match on the header to find a fit. | |
99 | |
100 The second element can also be a function. In that case, it will be | |
101 called narrowed to the headers with the first element of the rule as | |
102 the argument. It should return a non-nil value if it thinks that the | |
103 mail belongs in that group. | |
104 | |
105 The last element should always have \"\" as the regexp. | |
106 | |
107 This variable can also have a function as its value." | |
108 :group 'nnmail-split | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
109 :type '(choice (repeat :tag "Alist" (group (string :tag "Name") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
110 (choice regexp function))) |
17493 | 111 (function-item nnmail-split-fancy) |
112 (function :tag "Other"))) | |
113 | |
114 ;; Suggested by Erik Selberg <speed@cs.washington.edu>. | |
115 (defcustom nnmail-crosspost t | |
116 "If non-nil, do crossposting if several split methods match the mail. | |
117 If nil, the first match found will be used." | |
118 :group 'nnmail-split | |
119 :type 'boolean) | |
120 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
121 (defcustom nnmail-split-fancy-with-parent-ignore-groups nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
122 "Regexp that matches group names to be ignored when applying `nnmail-split-fancy-with-parent'. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
123 This can also be a list of regexps." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
124 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
125 :group 'nnmail-split |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
126 :type '(choice (const :tag "none" nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
127 (regexp :value ".*") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
128 (repeat :value (".*") regexp))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
129 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
130 (defcustom nnmail-cache-ignore-groups nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
131 "Regexp that matches group names to be ignored when inserting message ids into the cache (`nnmail-cache-insert'). |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
132 This can also be a list of regexps." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
133 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
134 :group 'nnmail-split |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
135 :type '(choice (const :tag "none" nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
136 (regexp :value ".*") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
137 (repeat :value (".*") regexp))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
138 |
17493 | 139 ;; Added by gord@enci.ucalgary.ca (Gordon Matzigkeit). |
140 (defcustom nnmail-keep-last-article nil | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
141 "If non-nil, nnmail will never delete/move a group's last article. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
142 It can be marked expirable, so it will be deleted when it is no longer last. |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
143 |
17493 | 144 You may need to set this variable if other programs are putting |
145 new mail into folder numbers that Gnus has marked as expired." | |
146 :group 'nnmail-procmail | |
147 :group 'nnmail-various | |
148 :type 'boolean) | |
149 | |
150 (defcustom nnmail-use-long-file-names nil | |
151 "If non-nil the mail backends will use long file and directory names. | |
152 If nil, groups like \"mail.misc\" will end up in directories like | |
153 \"mail/misc/\"." | |
154 :group 'nnmail-files | |
155 :type 'boolean) | |
156 | |
157 (defcustom nnmail-default-file-modes 384 | |
158 "Set the mode bits of all new mail files to this integer." | |
159 :group 'nnmail-files | |
160 :type 'integer) | |
161 | |
162 (defcustom nnmail-expiry-wait 7 | |
163 "*Expirable articles that are older than this will be expired. | |
164 This variable can either be a number (which will be interpreted as a | |
165 number of days) -- this doesn't have to be an integer. This variable | |
166 can also be `immediate' and `never'." | |
167 :group 'nnmail-expire | |
168 :type '(choice (const immediate) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
169 (number :tag "days") |
17493 | 170 (const never))) |
171 | |
172 (defcustom nnmail-expiry-wait-function nil | |
173 "Variable that holds function to specify how old articles should be before they are expired. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
174 The function will be called with the name of the group that the expiry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
175 is to be performed in, and it should return an integer that says how |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
176 many days an article can be stored before it is considered \"old\". |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
177 It can also return the values `never' and `immediate'. |
17493 | 178 |
179 Eg.: | |
180 | |
181 \(setq nnmail-expiry-wait-function | |
182 (lambda (newsgroup) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
183 (cond ((string-match \"private\" newsgroup) 31) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
184 ((string-match \"junk\" newsgroup) 1) |
17493 | 185 ((string-match \"important\" newsgroup) 'never) |
186 (t 7))))" | |
187 :group 'nnmail-expire | |
188 :type '(choice (const :tag "nnmail-expiry-wait" nil) | |
189 (function :format "%v" nnmail-))) | |
190 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
191 (defcustom nnmail-expiry-target 'delete |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
192 "*Variable that says where expired messages should end up. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
193 The default value is `delete' (which says to delete the messages), |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
194 but it can also be a string or a function. If it is a string, expired |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
195 messages end up in that group. If it is a function, the function is |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
196 called in a buffer narrowed to the message in question. The function |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
197 receives one argument, the name of the group the message comes from. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
198 The return value should be `delete' or a group name (a string)." |
33398 | 199 :version "21.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
200 :group 'nnmail-expire |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
201 :type '(choice (const delete) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
202 (function :format "%v" nnmail-) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
203 string)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
204 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
205 (defcustom nnmail-fancy-expiry-targets nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
206 "Determine expiry target based on articles using fancy techniques. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
207 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
208 This is a list of (\"HEADER\" \"REGEXP\" \"TARGET\") entries. If |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
209 `nnmail-expiry-target' is set to the function |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
210 `nnmail-fancy-expiry-target' and HEADER of the article matches REGEXP, |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
211 the message will be expired to a group determined by invoking |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
212 `format-time-string' with TARGET used as the format string and the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
213 time extracted from the articles' Date header (if missing the current |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
214 time is used). |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
215 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
216 In the special cases that HEADER is the symbol `to-from', the regexp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
217 will try to match against both the From and the To header. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
218 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
219 Example: |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
220 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
221 \(setq nnmail-fancy-expiry-targets |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
222 '((to-from \"boss\" \"nnfolder:Work\") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
223 (\"Subject\" \"IMPORTANT\" \"nnfolder:IMPORTANT.%Y.%b\") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
224 (\"from\" \".*\" \"nnfolder:Archive-%Y\"))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
225 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
226 In this case, articles containing the string \"boss\" in the To or the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
227 From header will be expired to the group \"nnfolder:Work\"; |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
228 articles containing the sting \"IMPORTANT\" in the Subject header will |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
229 be expired to the group \"nnfolder:IMPORTANT.YYYY.MMM\"; and |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
230 everything else will be expired to \"nnfolder:Archive-YYYY\"." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
231 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
232 :group 'nnmail-expire |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
233 :type '(repeat (list (choice :tag "Match against" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
234 (string :tag "Header") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
235 (const to-from)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
236 regexp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
237 (string :tag "Target group format string")))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
238 |
17493 | 239 (defcustom nnmail-cache-accepted-message-ids nil |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
240 "If non-nil, put Message-IDs of Gcc'd articles into the duplicate cache. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
241 If non-nil, also update the cache when copy or move articles." |
17493 | 242 :group 'nnmail |
243 :type 'boolean) | |
244 | |
76836
9feeb7a817c0
* nnmail.el (nnmail-spool-file): Mark as obsolete.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
75347
diff
changeset
|
245 (make-obsolete-variable 'nnmail-spool-file |
9feeb7a817c0
* nnmail.el (nnmail-spool-file): Mark as obsolete.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
75347
diff
changeset
|
246 "This option is obsolete in Gnus 5.9. \ |
9feeb7a817c0
* nnmail.el (nnmail-spool-file): Mark as obsolete.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
75347
diff
changeset
|
247 Use `mail-sources' instead.") |
9feeb7a817c0
* nnmail.el (nnmail-spool-file): Mark as obsolete.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
75347
diff
changeset
|
248 ;; revision 5.29 / p0-85 / Gnus 5.9 |
87097 | 249 ;; Variable removed in No Gnus v0.7 |
17493 | 250 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
251 (defcustom nnmail-resplit-incoming nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
252 "*If non-nil, re-split incoming procmail sorted mail." |
17493 | 253 :group 'nnmail-procmail |
254 :type 'boolean) | |
255 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
256 (defcustom nnmail-scan-directory-mail-source-once nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
257 "*If non-nil, scan all incoming procmail sorted mails once. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
258 It scans low-level sorted spools even when not required." |
33398 | 259 :version "21.1" |
17493 | 260 :group 'nnmail-procmail |
261 :type 'boolean) | |
262 | |
263 (defcustom nnmail-delete-file-function 'delete-file | |
264 "Function called to delete files in some mail backends." | |
265 :group 'nnmail-files | |
266 :type 'function) | |
267 | |
268 (defcustom nnmail-crosspost-link-function | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
269 (if (string-match "windows-nt\\|emx" (symbol-name system-type)) |
17493 | 270 'copy-file |
271 'add-name-to-file) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
272 "*Function called to create a copy of a file. |
17493 | 273 This is `add-name-to-file' by default, which means that crossposts |
274 will use hard links. If your file system doesn't allow hard | |
275 links, you could set this variable to `copy-file' instead." | |
276 :group 'nnmail-files | |
277 :type '(radio (function-item add-name-to-file) | |
278 (function-item copy-file) | |
279 (function :tag "Other"))) | |
280 | |
281 (defcustom nnmail-read-incoming-hook | |
282 (if (eq system-type 'windows-nt) | |
283 '(nnheader-ms-strip-cr) | |
284 nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
285 "*Hook that will be run after the incoming mail has been transferred. |
31785 | 286 The incoming mail is moved from the specified spool file (which normally is |
17493 | 287 something like \"/usr/spool/mail/$user\") to the user's home |
288 directory. This hook is called after the incoming mail box has been | |
289 emptied, and can be used to call any mail box programs you have | |
290 running (\"xwatch\", etc.) | |
291 | |
292 Eg. | |
293 | |
294 \(add-hook 'nnmail-read-incoming-hook | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
295 (lambda () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
296 (call-process \"/local/bin/mailsend\" nil nil nil |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
297 \"read\" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
298 ;; The incoming mail box file. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
299 (expand-file-name (user-login-name) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
300 rmail-spool-directory)))) |
17493 | 301 |
302 If you have xwatch running, this will alert it that mail has been | |
303 read. | |
304 | |
305 If you use `display-time', you could use something like this: | |
306 | |
307 \(add-hook 'nnmail-read-incoming-hook | |
308 (lambda () | |
309 ;; Update the displayed time, since that will clear out | |
310 ;; the flag that says you have mail. | |
311 (when (eq (process-status \"display-time\") 'run) | |
312 (display-time-filter display-time-process \"\"))))" | |
313 :group 'nnmail-prepare | |
314 :type 'hook) | |
315 | |
316 (defcustom nnmail-prepare-incoming-hook nil | |
317 "Hook called before treating incoming mail. | |
318 The hook is run in a buffer with all the new, incoming mail." | |
319 :group 'nnmail-prepare | |
320 :type 'hook) | |
321 | |
322 (defcustom nnmail-prepare-incoming-header-hook nil | |
323 "Hook called narrowed to the headers of each message. | |
324 This can be used to remove excessive spaces (and stuff like | |
325 that) from the headers before splitting and saving the messages." | |
326 :group 'nnmail-prepare | |
327 :type 'hook) | |
328 | |
329 (defcustom nnmail-prepare-incoming-message-hook nil | |
330 "Hook called narrowed to each message." | |
331 :group 'nnmail-prepare | |
332 :type 'hook) | |
333 | |
334 (defcustom nnmail-list-identifiers nil | |
335 "Regexp that matches list identifiers to be removed. | |
336 This can also be a list of regexps." | |
337 :group 'nnmail-prepare | |
338 :type '(choice (const :tag "none" nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
339 (regexp :value ".*") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
340 (repeat :value (".*") regexp))) |
17493 | 341 |
342 (defcustom nnmail-pre-get-new-mail-hook nil | |
343 "Hook called just before starting to handle new incoming mail." | |
344 :group 'nnmail-retrieve | |
345 :type 'hook) | |
346 | |
347 (defcustom nnmail-post-get-new-mail-hook nil | |
348 "Hook called just after finishing handling new incoming mail." | |
349 :group 'nnmail-retrieve | |
350 :type 'hook) | |
351 | |
352 (defcustom nnmail-split-hook nil | |
353 "Hook called before deciding where to split an article. | |
354 The functions in this hook are free to modify the buffer | |
355 contents in any way they choose -- the buffer contents are | |
356 discarded after running the split process." | |
357 :group 'nnmail-split | |
358 :type 'hook) | |
359 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
360 (defcustom nnmail-spool-hook nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
361 "*A hook called when a new article is spooled." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
362 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
363 :group 'nnmail |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
364 :type 'hook) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
365 |
17493 | 366 (defcustom nnmail-large-newsgroup 50 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
367 "*The number of articles which indicates a large newsgroup or nil. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
368 If the number of articles is greater than the value, verbose |
17493 | 369 messages will be shown to indicate the current status." |
370 :group 'nnmail-various | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
371 :type '(choice (const :tag "infinite" nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
372 (number :tag "count"))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
373 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
374 (define-widget 'nnmail-lazy 'default |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
375 "Base widget for recursive datastructures. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
376 |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
377 This is copy of the `lazy' widget in Emacs 22.1 provided for compatibility." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
378 :format "%{%t%}: %v" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
379 :convert-widget 'widget-value-convert-widget |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
380 :value-create (lambda (widget) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
381 (let ((value (widget-get widget :value)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
382 (type (widget-get widget :type))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
383 (widget-put widget :children |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
384 (list (widget-create-child-value |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
385 widget (widget-convert type) value))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
386 :value-delete 'widget-children-value-delete |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
387 :value-get (lambda (widget) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
388 (widget-value (car (widget-get widget :children)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
389 :value-inline (lambda (widget) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
390 (widget-apply (car (widget-get widget :children)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
391 :value-inline)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
392 :default-get (lambda (widget) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
393 (widget-default-get |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
394 (widget-convert (widget-get widget :type)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
395 :match (lambda (widget value) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
396 (widget-apply (widget-convert (widget-get widget :type)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
397 :match value)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
398 :validate (lambda (widget) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
399 (widget-apply (car (widget-get widget :children)) :validate))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
400 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
401 (define-widget 'nnmail-split-fancy 'nnmail-lazy |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
402 "Widget for customizing splits in the variable of the same name." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
403 :tag "Split" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
404 :type '(menu-choice :value (any ".*value.*" "misc") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
405 :tag "Type" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
406 (string :tag "Destination") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
407 (list :tag "Use first match (|)" :value (|) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
408 (const :format "" |) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
409 (editable-list :inline t nnmail-split-fancy)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
410 (list :tag "Use all matches (&)" :value (&) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
411 (const :format "" &) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
412 (editable-list :inline t nnmail-split-fancy)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
413 (list :tag "Function with fixed arguments (:)" |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
414 :value (:) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
415 (const :format "" :value :) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
416 function |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
417 (editable-list :inline t (sexp :tag "Arg")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
418 ) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
419 (list :tag "Function with split arguments (!)" |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
420 :value (!) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
421 (const :format "" !) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
422 function |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
423 (editable-list :inline t nnmail-split-fancy)) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
424 (list :tag "Field match" |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
425 (choice :tag "Field" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
426 regexp symbol) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
427 (choice :tag "Match" |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
428 regexp |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
429 (symbol :value mail)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
430 (repeat :inline t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
431 :tag "Restrictions" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
432 (group :inline t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
433 (const :format "" -) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
434 regexp)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
435 nnmail-split-fancy) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
436 (const :tag "Junk (delete mail)" junk))) |
17493 | 437 |
438 (defcustom nnmail-split-fancy "mail.misc" | |
439 "Incoming mail can be split according to this fancy variable. | |
440 To enable this, set `nnmail-split-methods' to `nnmail-split-fancy'. | |
441 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
442 The format of this variable is SPLIT, where SPLIT can be one of |
17493 | 443 the following: |
444 | |
445 GROUP: Mail will be stored in GROUP (a string). | |
446 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
447 \(FIELD VALUE [- RESTRICT [- RESTRICT [...]]] SPLIT): If the message |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49274
diff
changeset
|
448 field FIELD (a regexp) contains VALUE (a regexp), store the messages |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
449 as specified by SPLIT. If RESTRICT (a regexp) matches some string |
42206 | 450 after FIELD and before the end of the matched VALUE, return nil, |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
451 otherwise process SPLIT. Multiple RESTRICTs add up, further |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
452 restricting the possibility of processing SPLIT. |
17493 | 453 |
454 \(| SPLIT...): Process each SPLIT expression until one of them matches. | |
455 A SPLIT expression is said to match if it will cause the mail | |
456 message to be stored in one or more groups. | |
457 | |
458 \(& SPLIT...): Process each SPLIT expression. | |
459 | |
460 \(: FUNCTION optional args): Call FUNCTION with the optional args, in | |
461 the buffer containing the message headers. The return value FUNCTION | |
462 should be a split, which is then recursively processed. | |
463 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
464 \(! FUNCTION SPLIT): Call FUNCTION with the result of SPLIT. The |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
465 return value FUNCTION should be a split, which is then recursively |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
466 processed. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
467 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
468 junk: Mail will be deleted. Use with care! Do not submerge in water! |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
469 Example: |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
470 (setq nnmail-split-fancy |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
471 '(| (\"Subject\" \"MAKE MONEY FAST\" junk) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
472 ...other.rules.omitted...)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
473 |
17493 | 474 FIELD must match a complete field name. VALUE must match a complete |
475 word according to the `nnmail-split-fancy-syntax-table' syntax table. | |
476 You can use \".*\" in the regexps to match partial field names or words. | |
477 | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
478 FIELD and VALUE can also be Lisp symbols, in that case they are expanded |
17493 | 479 as specified in `nnmail-split-abbrev-alist'. |
480 | |
481 GROUP can contain \\& and \\N which will substitute from matching | |
482 \\(\\) patterns in the previous VALUE. | |
483 | |
484 Example: | |
485 | |
486 \(setq nnmail-split-methods 'nnmail-split-fancy | |
487 nnmail-split-fancy | |
488 ;; Messages from the mailer daemon are not crossposted to any of | |
489 ;; the ordinary groups. Warnings are put in a separate group | |
490 ;; from real errors. | |
491 '(| (\"from\" mail (| (\"subject\" \"warn.*\" \"mail.warning\") | |
492 \"mail.misc\")) | |
493 ;; Non-error messages are crossposted to all relevant | |
494 ;; groups, but we don't crosspost between the group for the | |
495 ;; (ding) list and the group for other (ding) related mail. | |
496 (& (| (any \"ding@ifi\\\\.uio\\\\.no\" \"ding.list\") | |
497 (\"subject\" \"ding\" \"ding.misc\")) | |
498 ;; Other mailing lists... | |
499 (any \"procmail@informatik\\\\.rwth-aachen\\\\.de\" \"procmail.list\") | |
500 (any \"SmartList@informatik\\\\.rwth-aachen\\\\.de\" \"SmartList.list\") | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
501 ;; Both lists below have the same suffix, so prevent |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
502 ;; cross-posting to mkpkg.list of messages posted only to |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
503 ;; the bugs- list, but allow cross-posting when the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
504 ;; message was really cross-posted. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
505 (any \"bugs-mypackage@somewhere\" \"mypkg.bugs\") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
506 (any \"mypackage@somewhere\" - \"bugs-mypackage\" \"mypkg.list\") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
507 ;; |
17493 | 508 ;; People... |
509 (any \"larsi@ifi\\\\.uio\\\\.no\" \"people.Lars Magne Ingebrigtsen\")) | |
510 ;; Unmatched mail goes to the catch all group. | |
511 \"misc.misc\"))" | |
512 :group 'nnmail-split | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
513 :type 'nnmail-split-fancy) |
17493 | 514 |
515 (defcustom nnmail-split-abbrev-alist | |
516 '((any . "from\\|to\\|cc\\|sender\\|apparently-to\\|resent-from\\|resent-to\\|resent-cc") | |
517 (mail . "mailer-daemon\\|postmaster\\|uucp") | |
518 (to . "to\\|cc\\|apparently-to\\|resent-to\\|resent-cc") | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
519 (from . "from\\|sender\\|resent-from") |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
520 (nato . "to\\|cc\\|resent-to\\|resent-cc") |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
521 (naany . "from\\|to\\|cc\\|sender\\|resent-from\\|resent-to\\|resent-cc")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
522 "*Alist of abbreviations allowed in `nnmail-split-fancy'." |
17493 | 523 :group 'nnmail-split |
524 :type '(repeat (cons :format "%v" symbol regexp))) | |
525 | |
526 (defcustom nnmail-message-id-cache-length 1000 | |
527 "*The approximate number of Message-IDs nnmail will keep in its cache. | |
528 If this variable is nil, no checking on duplicate messages will be | |
529 performed." | |
530 :group 'nnmail-duplicate | |
531 :type '(choice (const :tag "disable" nil) | |
532 (integer :format "%v"))) | |
533 | |
92147 | 534 (defcustom nnmail-message-id-cache-file |
535 (nnheader-concat gnus-home-directory ".nnmail-cache") | |
536 "The file name of the nnmail Message-ID cache." | |
17493 | 537 :group 'nnmail-duplicate |
538 :group 'nnmail-files | |
539 :type 'file) | |
540 | |
541 (defcustom nnmail-treat-duplicates 'warn | |
542 "*If non-nil, nnmail keep a cache of Message-IDs to discover mail duplicates. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
543 Three values are valid: nil, which means that nnmail is not to keep a |
17493 | 544 Message-ID cache; `warn', which means that nnmail should insert extra |
545 headers to warn the user about the duplication (this is the default); | |
546 and `delete', which means that nnmail will delete duplicated mails. | |
547 | |
548 This variable can also be a function. It will be called from a buffer | |
549 narrowed to the article in question with the Message-ID as a | |
550 parameter. It should return nil, `warn' or `delete'." | |
551 :group 'nnmail-duplicate | |
552 :type '(choice (const :tag "off" nil) | |
553 (const warn) | |
554 (const delete))) | |
555 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
556 (defcustom nnmail-extra-headers '(To Newsgroups) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
557 "*Extra headers to parse." |
33398 | 558 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
559 :group 'nnmail |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
560 :type '(repeat symbol)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
561 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
562 (defcustom nnmail-split-header-length-limit 2048 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
563 "Header lines longer than this limit are excluded from the split function." |
33398 | 564 :version "21.1" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
565 :group 'nnmail |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
566 :type 'integer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
567 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
568 (defcustom nnmail-mail-splitting-charset nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
569 "Default charset to be used when splitting incoming mail." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
570 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
571 :group 'nnmail |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
572 :type 'symbol) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
573 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
574 (defcustom nnmail-mail-splitting-decodes nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
575 "Whether the nnmail splitting functionality should MIME decode headers." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
576 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
577 :group 'nnmail |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
578 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
579 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
580 (defcustom nnmail-split-fancy-match-partial-words nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
581 "Whether to match partial words when fancy splitting. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
582 Normally, regexes given in `nnmail-split-fancy' are implicitly surrounded |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
583 by \"\\=\\<...\\>\". If this variable is true, they are not implicitly\ |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
584 surrounded |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
585 by anything." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
586 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
587 :group 'nnmail |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
588 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
589 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
590 (defcustom nnmail-split-lowercase-expanded t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
591 "Whether to lowercase expanded entries (i.e. \\N) when splitting mails. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
592 This avoids the creation of multiple groups when users send to an address |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
593 using different case (i.e. mailing-list@domain vs Mailing-List@Domain)." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
594 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
595 :group 'nnmail |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
596 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
597 |
17493 | 598 ;;; Internal variables. |
599 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
600 (defvar nnmail-article-buffer " *nnmail incoming*" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
601 "The buffer used for splitting incoming mails.") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
602 |
17493 | 603 (defvar nnmail-split-history nil |
604 "List of group/article elements that say where the previous split put messages.") | |
605 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
606 (defvar nnmail-split-fancy-syntax-table |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
607 (let ((table (make-syntax-table))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
608 ;; support the %-hack |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
609 (modify-syntax-entry ?\% "." table) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
610 table) |
17493 | 611 "Syntax table used by `nnmail-split-fancy'.") |
612 | |
613 (defvar nnmail-prepare-save-mail-hook nil | |
614 "Hook called before saving mail.") | |
615 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
616 (defvar nnmail-split-tracing nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
617 (defvar nnmail-split-trace nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
618 |
17493 | 619 |
620 | |
621 (defun nnmail-request-post (&optional server) | |
622 (mail-send-and-exit nil)) | |
623 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
624 (defvar nnmail-file-coding-system 'raw-text |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
625 "Coding system used in nnmail.") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
626 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
627 (defvar nnmail-incoming-coding-system |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
628 mm-text-coding-system |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
629 "Coding system used in reading inbox") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
630 |
38861
f8833aa83b5e
* gnus-art.el (gnus-output-to-file): Bind file-name-coding-system.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
35453
diff
changeset
|
631 (defvar nnmail-pathname-coding-system nil |
49274
eb2699620e9c
* gnus-agent.el: Don't use `path'.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
48588
diff
changeset
|
632 "*Coding system for file name.") |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
633 |
17493 | 634 (defun nnmail-find-file (file) |
635 "Insert FILE in server buffer safely." | |
636 (set-buffer nntp-server-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
637 (delete-region (point-min) (point-max)) |
17493 | 638 (let ((format-alist nil) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
639 (after-insert-file-functions nil)) |
17493 | 640 (condition-case () |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
641 (let ((coding-system-for-read nnmail-file-coding-system) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
642 (auto-mode-alist (mm-auto-mode-alist)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
643 (file-name-coding-system nnmail-pathname-coding-system)) |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
644 (insert-file-contents file) |
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
645 t) |
17493 | 646 (file-error nil)))) |
647 | |
648 (defun nnmail-group-pathname (group dir &optional file) | |
49274
eb2699620e9c
* gnus-agent.el: Don't use `path'.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
48588
diff
changeset
|
649 "Make file name for GROUP." |
17493 | 650 (concat |
651 (let ((dir (file-name-as-directory (expand-file-name dir)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
652 (setq group (nnheader-replace-duplicate-chars-in-string |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
653 (nnheader-replace-chars-in-string group ?/ ?_) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
654 ?. ?_)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
655 (setq group (nnheader-translate-file-chars group)) |
17493 | 656 ;; If this directory exists, we use it directly. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
657 (file-name-as-directory |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
658 (if (or nnmail-use-long-file-names |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
659 (file-directory-p (concat dir group))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
660 (expand-file-name group dir) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
661 ;; If not, we translate dots into slashes. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
662 (expand-file-name |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
663 (nnheader-replace-chars-in-string group ?. ?/) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
664 dir)))) |
17493 | 665 (or file ""))) |
666 | |
667 (defun nnmail-get-active () | |
668 "Returns an assoc of group names and active ranges. | |
669 nn*-request-list should have been called before calling this function." | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
670 ;; Go through all groups from the active list. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
671 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
672 (set-buffer nntp-server-buffer) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
673 (nnmail-parse-active))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
674 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
675 (defun nnmail-parse-active () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
676 "Parse the active file in the current buffer and return an alist." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
677 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
678 (unless (re-search-forward "[\\\"]" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
679 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
680 (while (re-search-backward "[][';?()#]" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
681 (insert ?\\))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
682 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
683 (let ((buffer (current-buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
684 group-assoc group max min) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
685 (while (not (eobp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
686 (condition-case err |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
687 (progn |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
688 (narrow-to-region (point) (point-at-eol)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
689 (setq group (read buffer)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
690 (unless (stringp group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
691 (setq group (symbol-name group))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
692 (if (and (numberp (setq max (read buffer))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
693 (numberp (setq min (read buffer)))) |
86225 | 694 (push (list (mm-string-as-unibyte group) (cons min max)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
695 group-assoc))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
696 (error nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
697 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
698 (forward-line 1)) |
17493 | 699 group-assoc)) |
700 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
701 (defvar nnmail-active-file-coding-system 'raw-text |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
702 "*Coding system for active file.") |
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
703 |
17493 | 704 (defun nnmail-save-active (group-assoc file-name) |
705 "Save GROUP-ASSOC in ACTIVE-FILE." | |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
706 (let ((coding-system-for-write nnmail-active-file-coding-system)) |
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
707 (when file-name |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
708 (with-temp-file file-name |
86225 | 709 (mm-disable-multibyte) |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
710 (nnmail-generate-active group-assoc))))) |
17493 | 711 |
712 (defun nnmail-generate-active (alist) | |
713 "Generate an active file from group-alist ALIST." | |
714 (erase-buffer) | |
715 (let (group) | |
716 (while (setq group (pop alist)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
717 (insert (format "%S %d %d y\n" (intern (car group)) (cdadr group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
718 (caadr group)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
719 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
720 (while (search-backward "\\." nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
721 (delete-char 1)))) |
17493 | 722 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
723 (defun nnmail-get-split-group (file source) |
17493 | 724 "Find out whether this FILE is to be split into GROUP only. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
725 If SOURCE is a directory spec, try to return the group name component." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
726 (if (eq (car source) 'directory) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
727 (let ((file (file-name-nondirectory file))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
728 (mail-source-bind (directory source) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
729 (if (string-match (concat (regexp-quote suffix) "$") file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
730 (substring file 0 (match-beginning 0)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
731 nil))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
732 nil)) |
17493 | 733 |
734 (defun nnmail-process-babyl-mail-format (func artnum-func) | |
735 (let ((case-fold-search t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
736 (count 0) |
17493 | 737 start message-id content-length do-search end) |
738 (while (not (eobp)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
739 (goto-char (point-min)) |
17493 | 740 (re-search-forward |
741 "\n0, *unseen,+\n\\(\\*\\*\\* EOOH \\*\\*\\*\n\\)?" nil t) | |
742 (goto-char (match-end 0)) | |
743 (delete-region (match-beginning 0) (match-end 0)) | |
744 (narrow-to-region | |
745 (setq start (point)) | |
746 (progn | |
747 ;; Skip all the headers in case there are more "From "s... | |
748 (or (search-forward "\n\n" nil t) | |
749 (search-forward-regexp "^[^:]*\\( .*\\|\\)$" nil t) | |
750 (search-forward "")) | |
751 (point))) | |
752 ;; Unquote the ">From " line, if any. | |
753 (goto-char (point-min)) | |
754 (when (looking-at ">From ") | |
755 (replace-match "X-From-Line: ") ) | |
756 (run-hooks 'nnmail-prepare-incoming-header-hook) | |
757 (goto-char (point-max)) | |
758 ;; Find the Message-ID header. | |
759 (save-excursion | |
760 (if (re-search-backward | |
761 "^Message-ID[ \t]*:[ \n\t]*\\(<[^>]*>\\)" nil t) | |
762 (setq message-id (buffer-substring (match-beginning 1) | |
763 (match-end 1))) | |
764 ;; There is no Message-ID here, so we create one. | |
765 (save-excursion | |
766 (when (re-search-backward "^Message-ID[ \t]*:" nil t) | |
767 (beginning-of-line) | |
768 (insert "Original-"))) | |
769 (forward-line -1) | |
770 (insert "Message-ID: " (setq message-id (nnmail-message-id)) | |
771 "\n"))) | |
772 ;; Look for a Content-Length header. | |
773 (if (not (save-excursion | |
774 (and (re-search-backward | |
775 "^Content-Length:[ \t]*\\([0-9]+\\)" start t) | |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
776 (setq content-length (string-to-number |
17493 | 777 (buffer-substring |
778 (match-beginning 1) | |
779 (match-end 1)))) | |
780 ;; We destroy the header, since none of | |
781 ;; the backends ever use it, and we do not | |
782 ;; want to confuse other mailers by having | |
783 ;; a (possibly) faulty header. | |
784 (progn (insert "X-") t)))) | |
785 (setq do-search t) | |
786 (widen) | |
787 (if (or (= (+ (point) content-length) (point-max)) | |
788 (save-excursion | |
789 (goto-char (+ (point) content-length)) | |
790 (looking-at ""))) | |
791 (progn | |
792 (goto-char (+ (point) content-length)) | |
793 (setq do-search nil)) | |
794 (setq do-search t))) | |
795 (widen) | |
796 ;; Go to the beginning of the next article - or to the end | |
797 ;; of the buffer. | |
798 (when do-search | |
799 (if (re-search-forward "^" nil t) | |
800 (goto-char (match-beginning 0)) | |
801 (goto-char (1- (point-max))))) | |
802 (delete-char 1) ; delete ^_ | |
803 (save-excursion | |
804 (save-restriction | |
805 (narrow-to-region start (point)) | |
806 (goto-char (point-min)) | |
807 (nnmail-check-duplication message-id func artnum-func) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
808 (incf count) |
17493 | 809 (setq end (point-max)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
810 (goto-char end)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
811 count)) |
17493 | 812 |
813 (defsubst nnmail-search-unix-mail-delim () | |
814 "Put point at the beginning of the next Unix mbox message." | |
45321
f767f3bf5f86
*** empty log message ***
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
815 ;; Algorithm used to find the next article in the |
17493 | 816 ;; brain-dead Unix mbox format: |
817 ;; | |
818 ;; 1) Search for "^From ". | |
819 ;; 2) If we find it, then see whether the previous | |
820 ;; line is blank and the next line looks like a header. | |
821 ;; Then it's possible that this is a mail delim, and we use it. | |
822 (let ((case-fold-search nil) | |
823 found) | |
824 (while (not found) | |
825 (if (not (re-search-forward "^From " nil t)) | |
826 (setq found 'no) | |
827 (save-excursion | |
828 (beginning-of-line) | |
829 (when (and (or (bobp) | |
830 (save-excursion | |
831 (forward-line -1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
832 (eq (char-after) ?\n))) |
17493 | 833 (save-excursion |
834 (forward-line 1) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
835 (while (looking-at ">From \\|From ") |
17493 | 836 (forward-line 1)) |
837 (looking-at "[^ \n\t:]+[ \n\t]*:"))) | |
838 (setq found 'yes))))) | |
839 (beginning-of-line) | |
840 (eq found 'yes))) | |
841 | |
842 (defun nnmail-search-unix-mail-delim-backward () | |
843 "Put point at the beginning of the current Unix mbox message." | |
45321
f767f3bf5f86
*** empty log message ***
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
844 ;; Algorithm used to find the next article in the |
17493 | 845 ;; brain-dead Unix mbox format: |
846 ;; | |
847 ;; 1) Search for "^From ". | |
848 ;; 2) If we find it, then see whether the previous | |
849 ;; line is blank and the next line looks like a header. | |
850 ;; Then it's possible that this is a mail delim, and we use it. | |
851 (let ((case-fold-search nil) | |
852 found) | |
853 (while (not found) | |
854 (if (not (re-search-backward "^From " nil t)) | |
855 (setq found 'no) | |
856 (save-excursion | |
857 (beginning-of-line) | |
858 (when (and (or (bobp) | |
859 (save-excursion | |
860 (forward-line -1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
861 (eq (char-after) ?\n))) |
17493 | 862 (save-excursion |
863 (forward-line 1) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
864 (while (looking-at ">From \\|From ") |
17493 | 865 (forward-line 1)) |
866 (looking-at "[^ \n\t:]+[ \n\t]*:"))) | |
867 (setq found 'yes))))) | |
868 (beginning-of-line) | |
869 (eq found 'yes))) | |
870 | |
871 (defun nnmail-process-unix-mail-format (func artnum-func) | |
872 (let ((case-fold-search t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
873 (count 0) |
17493 | 874 start message-id content-length end skip head-end) |
875 (goto-char (point-min)) | |
876 (if (not (and (re-search-forward "^From " nil t) | |
877 (goto-char (match-beginning 0)))) | |
878 ;; Possibly wrong format? | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
879 (error "Error, unknown mail format! (Possibly corrupted %s `%s'.)" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
880 (if (buffer-file-name) "file" "buffer") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
881 (or (buffer-file-name) (buffer-name))) |
17493 | 882 ;; Carry on until the bitter end. |
883 (while (not (eobp)) | |
884 (setq start (point) | |
885 end nil) | |
886 ;; Find the end of the head. | |
887 (narrow-to-region | |
888 start | |
889 (if (search-forward "\n\n" nil t) | |
890 (1- (point)) | |
891 ;; This will never happen, but just to be on the safe side -- | |
892 ;; if there is no head-body delimiter, we search a bit manually. | |
893 (while (and (looking-at "From \\|[^ \t]+:") | |
894 (not (eobp))) | |
895 (forward-line 1)) | |
896 (point))) | |
897 ;; Find the Message-ID header. | |
898 (goto-char (point-min)) | |
899 (if (re-search-forward "^Message-ID[ \t]*:[ \n\t]*\\(<[^>]+>\\)" nil t) | |
900 (setq message-id (match-string 1)) | |
901 (save-excursion | |
902 (when (re-search-forward "^Message-ID[ \t]*:" nil t) | |
903 (beginning-of-line) | |
904 (insert "Original-"))) | |
905 ;; There is no Message-ID here, so we create one. | |
906 (forward-line 1) | |
907 (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n")) | |
908 ;; Look for a Content-Length header. | |
909 (goto-char (point-min)) | |
910 (if (not (re-search-forward | |
911 "^Content-Length:[ \t]*\\([0-9]+\\)" nil t)) | |
912 (setq content-length nil) | |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
913 (setq content-length (string-to-number (match-string 1))) |
17493 | 914 ;; We destroy the header, since none of the backends ever |
915 ;; use it, and we do not want to confuse other mailers by | |
916 ;; having a (possibly) faulty header. | |
917 (beginning-of-line) | |
918 (insert "X-")) | |
919 (run-hooks 'nnmail-prepare-incoming-header-hook) | |
920 ;; Find the end of this article. | |
921 (goto-char (point-max)) | |
922 (widen) | |
923 (setq head-end (point)) | |
924 ;; We try the Content-Length value. The idea: skip over the header | |
925 ;; separator, then check what happens content-length bytes into the | |
48588 | 926 ;; message body. This should be either the end of the buffer, the |
17493 | 927 ;; message separator or a blank line followed by the separator. |
928 ;; The blank line should probably be deleted. If neither of the | |
929 ;; three is met, the content-length header is probably invalid. | |
930 (when content-length | |
931 (forward-line 1) | |
932 (setq skip (+ (point) content-length)) | |
933 (goto-char skip) | |
934 (cond ((or (= skip (point-max)) | |
935 (= (1+ skip) (point-max))) | |
936 (setq end (point-max))) | |
937 ((looking-at "From ") | |
938 (setq end skip)) | |
939 ((looking-at "[ \t]*\n\\(From \\)") | |
940 (setq end (match-beginning 1))) | |
941 (t (setq end nil)))) | |
942 (if end | |
943 (goto-char end) | |
944 ;; No Content-Length, so we find the beginning of the next | |
945 ;; article or the end of the buffer. | |
946 (goto-char head-end) | |
947 (or (nnmail-search-unix-mail-delim) | |
948 (goto-char (point-max)))) | |
949 ;; Allow the backend to save the article. | |
950 (save-excursion | |
951 (save-restriction | |
952 (narrow-to-region start (point)) | |
953 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
954 (incf count) |
17493 | 955 (nnmail-check-duplication message-id func artnum-func) |
956 (setq end (point-max)))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
957 (goto-char end))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
958 count)) |
17493 | 959 |
960 (defun nnmail-process-mmdf-mail-format (func artnum-func) | |
961 (let ((delim "^\^A\^A\^A\^A$") | |
962 (case-fold-search t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
963 (count 0) |
17493 | 964 start message-id end) |
965 (goto-char (point-min)) | |
966 (if (not (and (re-search-forward delim nil t) | |
967 (forward-line 1))) | |
968 ;; Possibly wrong format? | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
969 (error "Error, unknown mail format! (Possibly corrupted.)") |
17493 | 970 ;; Carry on until the bitter end. |
971 (while (not (eobp)) | |
972 (setq start (point)) | |
973 ;; Find the end of the head. | |
974 (narrow-to-region | |
975 start | |
976 (if (search-forward "\n\n" nil t) | |
977 (1- (point)) | |
978 ;; This will never happen, but just to be on the safe side -- | |
979 ;; if there is no head-body delimiter, we search a bit manually. | |
980 (while (and (looking-at "From \\|[^ \t]+:") | |
981 (not (eobp))) | |
982 (forward-line 1)) | |
983 (point))) | |
984 ;; Find the Message-ID header. | |
985 (goto-char (point-min)) | |
986 (if (re-search-forward "^Message-ID[ \t]*:[ \n\t]*\\(<[^>]+>\\)" nil t) | |
987 (setq message-id (match-string 1)) | |
988 ;; There is no Message-ID here, so we create one. | |
989 (save-excursion | |
990 (when (re-search-backward "^Message-ID[ \t]*:" nil t) | |
991 (beginning-of-line) | |
992 (insert "Original-"))) | |
993 (forward-line 1) | |
994 (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n")) | |
995 (run-hooks 'nnmail-prepare-incoming-header-hook) | |
996 ;; Find the end of this article. | |
997 (goto-char (point-max)) | |
998 (widen) | |
999 (if (re-search-forward delim nil t) | |
1000 (beginning-of-line) | |
1001 (goto-char (point-max))) | |
1002 ;; Allow the backend to save the article. | |
1003 (save-excursion | |
1004 (save-restriction | |
1005 (narrow-to-region start (point)) | |
1006 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1007 (incf count) |
17493 | 1008 (nnmail-check-duplication message-id func artnum-func) |
1009 (setq end (point-max)))) | |
1010 (goto-char end) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1011 (forward-line 2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1012 count)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1013 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1014 (defun nnmail-process-maildir-mail-format (func artnum-func) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1015 ;; In a maildir, every file contains exactly one mail. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1016 (let ((case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1017 message-id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1018 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1019 ;; Find the end of the head. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1020 (narrow-to-region |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1021 (point-min) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1022 (if (search-forward "\n\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1023 (1- (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1024 ;; This will never happen, but just to be on the safe side -- |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1025 ;; if there is no head-body delimiter, we search a bit manually. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1026 (while (and (looking-at "From \\|[^ \t]+:") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1027 (not (eobp))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1028 (forward-line 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1029 (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1030 ;; Find the Message-ID header. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1031 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1032 (if (re-search-forward "^Message-ID:[ \t]*\\(<[^>]+>\\)" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1033 (setq message-id (match-string 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1034 ;; There is no Message-ID here, so we create one. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1035 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1036 (when (re-search-backward "^Message-ID[ \t]*:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1037 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1038 (insert "Original-"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1039 (forward-line 1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1040 (insert "Message-ID: " (setq message-id (nnmail-message-id)) "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1041 (run-hooks 'nnmail-prepare-incoming-header-hook) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1042 ;; Allow the backend to save the article. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1043 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1044 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1045 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1046 (nnmail-check-duplication message-id func artnum-func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1047 1)) |
17493 | 1048 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1049 (defvar nnmail-group-names-not-encoded-p nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1050 "Non-nil means group names are not encoded.") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1051 |
17493 | 1052 (defun nnmail-split-incoming (incoming func &optional exit-func |
1053 group artnum-func) | |
1054 "Go through the entire INCOMING file and pick out each individual mail. | |
1055 FUNC will be called with the buffer narrowed to each mail." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1056 (let ( ;; If this is a group-specific split, we bind the split |
17493 | 1057 ;; methods to just this group. |
1058 (nnmail-split-methods (if (and group | |
1059 (not nnmail-resplit-incoming)) | |
1060 (list (list group "")) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1061 nnmail-split-methods)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1062 (nnmail-group-names-not-encoded-p t)) |
17493 | 1063 (save-excursion |
1064 ;; Insert the incoming file. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1065 (set-buffer (get-buffer-create nnmail-article-buffer)) |
17493 | 1066 (erase-buffer) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1067 (let ((coding-system-for-read nnmail-incoming-coding-system)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1068 (mm-insert-file-contents incoming)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1069 (prog1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1070 (if (zerop (buffer-size)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1071 0 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1072 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1073 (save-excursion (run-hooks 'nnmail-prepare-incoming-hook)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1074 ;; Handle both babyl, MMDF and unix mail formats, since |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1075 ;; movemail will use the former when fetching from a |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1076 ;; mailbox, the latter when fetching from a file. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1077 (cond ((or (looking-at "\^L") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1078 (looking-at "BABYL OPTIONS:")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1079 (nnmail-process-babyl-mail-format func artnum-func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1080 ((looking-at "\^A\^A\^A\^A") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1081 (nnmail-process-mmdf-mail-format func artnum-func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1082 ((looking-at "Return-Path:") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1083 (nnmail-process-maildir-mail-format func artnum-func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1084 (t |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1085 (nnmail-process-unix-mail-format func artnum-func)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1086 (when exit-func |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1087 (funcall exit-func)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1088 (kill-buffer (current-buffer)))))) |
17493 | 1089 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1090 (defun nnmail-article-group (func &optional trace) |
17493 | 1091 "Look at the headers and return an alist of groups that match. |
1092 FUNC will be called with the group name to determine the article number." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1093 (let ((methods (or nnmail-split-methods '(("bogus" "")))) |
17493 | 1094 (obuf (current-buffer)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1095 group-art method grp) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1096 (if (and (sequencep methods) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1097 (= (length methods) 1)) |
17493 | 1098 ;; If there is only just one group to put everything in, we |
1099 ;; just return a list with just this one method in. | |
1100 (setq group-art | |
1101 (list (cons (caar methods) (funcall func (caar methods))))) | |
1102 ;; We do actual comparison. | |
1103 (save-excursion | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1104 ;; Copy the article into the work buffer. |
17493 | 1105 (set-buffer nntp-server-buffer) |
1106 (erase-buffer) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1107 (insert-buffer-substring obuf) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1108 ;; Narrow to headers. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1109 (narrow-to-region |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1110 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1111 (if (search-forward "\n\n" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1112 (point) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1113 (point-max))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1114 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1115 ;; Decode MIME headers and charsets. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1116 (when nnmail-mail-splitting-decodes |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1117 (let ((mail-parse-charset nnmail-mail-splitting-charset)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1118 (mail-decode-encoded-word-region (point-min) (point-max)))) |
17493 | 1119 ;; Fold continuation lines. |
1120 (goto-char (point-min)) | |
1121 (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t) | |
1122 (replace-match " " t t)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1123 ;; Nuke pathologically long headers. Since Gnus applies |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1124 ;; pathologically complex regexps to the buffer, lines |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1125 ;; that are looong will take longer than the Universe's |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1126 ;; existence to process. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1127 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1128 (while (not (eobp)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1129 (unless (< (move-to-column nnmail-split-header-length-limit) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1130 nnmail-split-header-length-limit) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1131 (delete-region (point) (point-at-eol))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1132 (forward-line 1)) |
17493 | 1133 ;; Allow washing. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1134 (goto-char (point-min)) |
17493 | 1135 (run-hooks 'nnmail-split-hook) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1136 (when (setq nnmail-split-tracing trace) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1137 (setq nnmail-split-trace nil)) |
17493 | 1138 (if (and (symbolp nnmail-split-methods) |
1139 (fboundp nnmail-split-methods)) | |
1140 (let ((split | |
72045
52eb98c2d37f
(nnmail-article-group): If splitting raises an error, give some
Karl Fogel <kfogel@red-bean.com>
parents:
69343
diff
changeset
|
1141 (condition-case error-info |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1142 ;; `nnmail-split-methods' is a function, so we |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1143 ;; just call this function here and use the |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1144 ;; result. |
17493 | 1145 (or (funcall nnmail-split-methods) |
1146 '("bogus")) | |
1147 (error | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1148 (nnheader-message |
72045
52eb98c2d37f
(nnmail-article-group): If splitting raises an error, give some
Karl Fogel <kfogel@red-bean.com>
parents:
69343
diff
changeset
|
1149 5 "Error in `nnmail-split-methods'; using `bogus' mail group: %S" error-info) |
17493 | 1150 (sit-for 1) |
1151 '("bogus"))))) | |
65846
a4e8d78ae3fb
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-574
Miles Bader <miles@gnu.org>
parents:
64754
diff
changeset
|
1152 (setq split (mm-delete-duplicates split)) |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1153 ;; The article may be "cross-posted" to `junk'. What |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1154 ;; to do? Just remove the `junk' spec. Don't really |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1155 ;; see anything else to do... |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1156 (let (elem) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1157 (while (setq elem (car (memq 'junk split))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1158 (setq split (delq elem split)))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1159 (when split |
17493 | 1160 (setq group-art |
1161 (mapcar | |
1162 (lambda (group) (cons group (funcall func group))) | |
1163 split)))) | |
1164 ;; Go through the split methods to find a match. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1165 (while (and methods |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1166 (or nnmail-crosspost |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1167 (not group-art))) |
17493 | 1168 (goto-char (point-max)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1169 (setq method (pop methods) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1170 grp (car method)) |
17493 | 1171 (if (or methods |
1172 (not (equal "" (nth 1 method)))) | |
1173 (when (and | |
1174 (ignore-errors | |
1175 (if (stringp (nth 1 method)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1176 (let ((expand (string-match "\\\\[0-9&]" grp)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1177 (pos (re-search-backward (cadr method) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1178 nil t))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1179 (and expand |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1180 (setq grp (nnmail-expand-newtext grp))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1181 pos) |
17493 | 1182 ;; Function to say whether this is a match. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1183 (funcall (nth 1 method) grp))) |
17493 | 1184 ;; Don't enter the article into the same |
1185 ;; group twice. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1186 (not (assoc grp group-art))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1187 (push (cons grp (funcall func grp)) |
17493 | 1188 group-art)) |
1189 ;; This is the final group, which is used as a | |
1190 ;; catch-all. | |
1191 (unless group-art | |
1192 (setq group-art | |
1193 (list (cons (car method) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1194 (funcall func (car method)))))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1195 ;; Fall back on "bogus" if all else fails. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1196 (unless group-art |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1197 (setq group-art (list (cons "bogus" (funcall func "bogus")))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1198 ;; Produce a trace if non-empty. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1199 (when (and trace nnmail-split-trace) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1200 (let ((restore (current-buffer))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1201 (nnheader-set-temp-buffer "*Split Trace*") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1202 (gnus-add-buffer) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1203 (dolist (trace (nreverse nnmail-split-trace)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1204 (prin1 trace (current-buffer)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1205 (insert "\n")) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1206 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1207 (gnus-configure-windows 'split-trace) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1208 (set-buffer restore))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1209 (widen) |
17493 | 1210 ;; See whether the split methods returned `junk'. |
1211 (if (equal group-art '(junk)) | |
1212 nil | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1213 ;; The article may be "cross-posted" to `junk'. What |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1214 ;; to do? Just remove the `junk' spec. Don't really |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1215 ;; see anything else to do... |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1216 (let (elem) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1217 (while (setq elem (car (memq 'junk group-art))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1218 (setq group-art (delq elem group-art))) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19593
diff
changeset
|
1219 (nreverse group-art))))))) |
17493 | 1220 |
1221 (defun nnmail-insert-lines () | |
1222 "Insert how many lines there are in the body of the mail. | |
1223 Return the number of characters in the body." | |
1224 (let (lines chars) | |
1225 (save-excursion | |
1226 (goto-char (point-min)) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49274
diff
changeset
|
1227 (unless (search-forward "\n\n" nil t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1228 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1229 (insert "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1230 (setq chars (- (point-max) (point))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1231 (setq lines (count-lines (point) (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1232 (forward-char -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1233 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1234 (when (re-search-backward "^Lines: " nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1235 (delete-region (point) (progn (forward-line 1) (point))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1236 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1237 (insert (format "Lines: %d\n" (max lines 0))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1238 chars))) |
17493 | 1239 |
1240 (defun nnmail-insert-xref (group-alist) | |
1241 "Insert an Xref line based on the (group . article) alist." | |
1242 (save-excursion | |
1243 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1244 (unless (search-forward "\n\n" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1245 (goto-char (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1246 (insert "\n")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1247 (forward-char -1) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1248 (when (re-search-backward "^Xref: " nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1249 (delete-region (match-beginning 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1250 (progn (forward-line 1) (point)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1251 (insert (format "Xref: %s" (system-name))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1252 (while group-alist |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1253 (insert (if (mm-multibyte-p) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1254 (mm-string-as-multibyte |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1255 (format " %s:%d" (caar group-alist) (cdar group-alist))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1256 (mm-string-as-unibyte |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1257 (format " %s:%d" (caar group-alist) (cdar group-alist))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1258 (setq group-alist (cdr group-alist))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1259 (insert "\n"))) |
17493 | 1260 |
1261 ;;; Message washing functions | |
1262 | |
1263 (defun nnmail-remove-leading-whitespace () | |
1264 "Remove excessive whitespace from all headers." | |
1265 (goto-char (point-min)) | |
1266 (while (re-search-forward "^\\([^ :]+: \\) +" nil t) | |
1267 (replace-match "\\1" t))) | |
1268 | |
1269 (defun nnmail-remove-list-identifiers () | |
1270 "Remove list identifiers from Subject headers." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1271 (let ((regexp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1272 (if (consp nnmail-list-identifiers) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1273 (mapconcat 'identity nnmail-list-identifiers " *\\|") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1274 nnmail-list-identifiers))) |
17493 | 1275 (when regexp |
1276 (goto-char (point-min)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1277 (while (re-search-forward |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1278 (concat "^Subject: +\\(R[Ee]: +\\)*\\(" regexp " *\\)") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1279 nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1280 (delete-region (match-beginning 2) (match-end 0)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1281 (beginning-of-line)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1282 (when (re-search-forward "^Subject: +\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1283 nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1284 (delete-region (match-beginning 1) (match-end 1)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1285 (beginning-of-line))))) |
17493 | 1286 |
1287 (defun nnmail-remove-tabs () | |
1288 "Translate TAB characters into SPACE characters." | |
1289 (subst-char-in-region (point-min) (point-max) ?\t ? t)) | |
1290 | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1291 (defcustom nnmail-broken-references-mailers |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1292 "^X-Mailer:.*\\(Eudora\\|Pegasus\\)" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1293 "Header line matching mailer producing bogus References lines. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1294 See `nnmail-ignore-broken-references'." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1295 :group 'nnmail-prepare |
92336
5f827896103e
Change defcustom :version from 23.0 to 23.1.
Glenn Morris <rgm@gnu.org>
parents:
92147
diff
changeset
|
1296 :version "23.1" ;; No Gnus |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1297 :type 'regexp) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1298 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1299 (defun nnmail-ignore-broken-references () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1300 "Ignore the References line and use In-Reply-To |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1301 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1302 Eudora has a broken References line, but an OK In-Reply-To." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1303 (goto-char (point-min)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1304 (when (re-search-forward nnmail-broken-references-mailers nil t) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1305 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1306 (when (re-search-forward "^References:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1307 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1308 (insert "X-Gnus-Broken-Eudora-")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1309 (goto-char (point-min)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1310 (when (re-search-forward "^\\(In-Reply-To:[^\n]+\\)\n[ \t]+" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1311 (replace-match "\\1" t)))) |
17493 | 1312 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1313 (defalias 'nnmail-fix-eudora-headers 'nnmail-ignore-broken-references) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1314 (make-obsolete 'nnmail-fix-eudora-headers 'nnmail-ignore-broken-references) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1315 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1316 (custom-add-option 'nnmail-prepare-incoming-header-hook |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1317 'nnmail-ignore-broken-references) |
17493 | 1318 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1319 ;;; Utility functions |
17493 | 1320 |
87232
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
1321 (declare-function gnus-activate-group "gnus-start" |
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
1322 (group &optional scan dont-check method)) |
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
1323 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1324 (defun nnmail-do-request-post (accept-func &optional server) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1325 "Utility function to directly post a message to an nnmail-derived group. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1326 Calls ACCEPT-FUNC (which should be `nnchoke-request-accept-article') |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1327 to actually put the message in the right group." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1328 (let ((success t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1329 (dolist (mbx (message-unquote-tokens |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1330 (message-tokenize-header |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1331 (message-fetch-field "Newsgroups") ", ")) success) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1332 (let ((to-newsgroup (gnus-group-prefixed-name mbx gnus-command-method))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1333 (or (gnus-active to-newsgroup) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1334 (gnus-activate-group to-newsgroup) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1335 (if (gnus-y-or-n-p (format "No such group: %s. Create it? " |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1336 to-newsgroup)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1337 (or (and (gnus-request-create-group |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1338 to-newsgroup gnus-command-method) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1339 (gnus-activate-group to-newsgroup nil nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1340 gnus-command-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1341 (error "Couldn't create group %s" to-newsgroup))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1342 (error "No such group: %s" to-newsgroup)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1343 (unless (funcall accept-func mbx (nth 1 gnus-command-method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1344 (setq success nil)))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1345 |
17493 | 1346 (defun nnmail-split-fancy () |
1347 "Fancy splitting method. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1348 See the documentation for the variable `nnmail-split-fancy' for details." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1349 (with-syntax-table nnmail-split-fancy-syntax-table |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1350 (nnmail-split-it nnmail-split-fancy))) |
17493 | 1351 |
1352 (defvar nnmail-split-cache nil) | |
1353 ;; Alist of split expressions their equivalent regexps. | |
1354 | |
1355 (defun nnmail-split-it (split) | |
1356 ;; Return a list of groups matching SPLIT. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1357 (let (cached-pair) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1358 (cond |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1359 ;; nil split |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1360 ((null split) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1361 nil) |
17493 | 1362 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1363 ;; A group name. Do the \& and \N subs into the string. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1364 ((stringp split) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1365 (when nnmail-split-tracing |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1366 (push split nnmail-split-trace)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1367 (list (nnmail-expand-newtext split))) |
17493 | 1368 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1369 ;; Junk the message. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1370 ((eq split 'junk) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1371 (when nnmail-split-tracing |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1372 (push "junk" nnmail-split-trace)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1373 (list 'junk)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1374 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1375 ;; Builtin & operation. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1376 ((eq (car split) '&) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1377 (apply 'nconc (mapcar 'nnmail-split-it (cdr split)))) |
17493 | 1378 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1379 ;; Builtin | operation. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1380 ((eq (car split) '|) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1381 (let (done) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1382 (while (and (not done) (cdr split)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1383 (setq split (cdr split) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1384 done (nnmail-split-it (car split)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1385 done)) |
17493 | 1386 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1387 ;; Builtin : operation. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1388 ((eq (car split) ':) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1389 (when nnmail-split-tracing |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1390 (push split nnmail-split-trace)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1391 (nnmail-split-it (save-excursion (eval (cdr split))))) |
17493 | 1392 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1393 ;; Builtin ! operation. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1394 ((eq (car split) '!) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1395 (funcall (cadr split) (nnmail-split-it (caddr split)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1396 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1397 ;; Check the cache for the regexp for this split. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1398 ((setq cached-pair (assq split nnmail-split-cache)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1399 (let (split-result |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1400 (end-point (point-max)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1401 (value (nth 1 split))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1402 (if (symbolp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1403 (setq value (cdr (assq value nnmail-split-abbrev-alist)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1404 (while (and (goto-char end-point) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1405 (re-search-backward (cdr cached-pair) nil t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1406 (when nnmail-split-tracing |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1407 (push split nnmail-split-trace)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1408 (let ((split-rest (cddr split)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1409 (end (match-end 0)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1410 ;; The searched regexp is \(\(FIELD\).*\)\(VALUE\). |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1411 ;; So, start-of-value is the point just before the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1412 ;; beginning of the value, whereas after-header-name |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1413 ;; is the point just after the field name. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1414 (start-of-value (match-end 1)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1415 (after-header-name (match-end 2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1416 ;; Start the next search just before the beginning of the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1417 ;; VALUE match. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1418 (setq end-point (1- start-of-value)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1419 ;; Handle - RESTRICTs |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1420 (while (eq (car split-rest) '-) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1421 ;; RESTRICT must start after-header-name and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1422 ;; end after start-of-value, so that, for |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1423 ;; (any "foo" - "x-foo" "foo.list") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1424 ;; we do not exclude foo.list just because |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1425 ;; the header is: ``To: x-foo, foo'' |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1426 (goto-char end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1427 (if (and (re-search-backward (cadr split-rest) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1428 after-header-name t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1429 (> (match-end 0) start-of-value)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1430 (setq split-rest nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1431 (setq split-rest (cddr split-rest)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1432 (when split-rest |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1433 (goto-char end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1434 (let ((value (nth 1 split))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1435 (if (symbolp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1436 (setq value (cdr (assq value nnmail-split-abbrev-alist)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1437 ;; Someone might want to do a \N sub on this match, so get the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1438 ;; correct match positions. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1439 (re-search-backward value start-of-value)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1440 (dolist (sp (nnmail-split-it (car split-rest))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1441 (unless (member sp split-result) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1442 (push sp split-result)))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1443 split-result)) |
17493 | 1444 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1445 ;; Not in cache, compute a regexp for the field/value pair. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1446 (t |
69343
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1447 (let ((field (nth 0 split)) |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1448 (value (nth 1 split)) |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1449 (split-rest (cddr split)) |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1450 partial-front |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1451 partial-rear |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1452 regexp) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1453 (if (symbolp value) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1454 (setq value (cdr (assq value nnmail-split-abbrev-alist)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1455 (if (and (>= (length value) 2) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1456 (string= ".*" (substring value 0 2))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1457 (setq value (substring value 2) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1458 partial-front "")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1459 ;; Same trick for the rear of the regexp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1460 (if (and (>= (length value) 2) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1461 (string= ".*" (substring value -2))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1462 (setq value (substring value 0 -2) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1463 partial-rear "")) |
69343
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1464 ;; Invert the match-partial-words behavior if the optional |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1465 ;; last element is specified. |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1466 (while (eq (car split-rest) '-) |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1467 (setq split-rest (cddr split-rest))) |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1468 (when (if (cadr split-rest) |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1469 (not nnmail-split-fancy-match-partial-words) |
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1470 nnmail-split-fancy-match-partial-words) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1471 (setq partial-front "" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1472 partial-rear "")) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1473 (setq regexp (concat "^\\(\\(" |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1474 (if (symbolp field) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1475 (cdr (assq field nnmail-split-abbrev-alist)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1476 field) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1477 "\\):.*\\)" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1478 (or partial-front "\\<") |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1479 "\\(" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1480 value |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1481 "\\)" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1482 (or partial-rear "\\>"))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1483 (push (cons split regexp) nnmail-split-cache) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1484 ;; Now that it's in the cache, just call nnmail-split-it again |
69343
10ae0483645d
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-143
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1485 ;; on the same split, which will find it immediately in the cache. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1486 (nnmail-split-it split)))))) |
17493 | 1487 |
1488 (defun nnmail-expand-newtext (newtext) | |
1489 (let ((len (length newtext)) | |
1490 (pos 0) | |
1491 c expanded beg N did-expand) | |
1492 (while (< pos len) | |
1493 (setq beg pos) | |
1494 (while (and (< pos len) | |
1495 (not (= (aref newtext pos) ?\\))) | |
1496 (setq pos (1+ pos))) | |
1497 (unless (= beg pos) | |
1498 (push (substring newtext beg pos) expanded)) | |
1499 (when (< pos len) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1500 ;; We hit a \; expand it. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1501 (setq did-expand t |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1502 pos (1+ pos) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1503 c (aref newtext pos)) |
17493 | 1504 (if (not (or (= c ?\&) |
1505 (and (>= c ?1) | |
1506 (<= c ?9)))) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1507 ;; \ followed by some character we don't expand. |
17493 | 1508 (push (char-to-string c) expanded) |
1509 ;; \& or \N | |
1510 (if (= c ?\&) | |
1511 (setq N 0) | |
1512 (setq N (- c ?0))) | |
1513 (when (match-beginning N) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1514 (push (if nnmail-split-lowercase-expanded |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1515 (downcase (buffer-substring (match-beginning N) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1516 (match-end N))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1517 (buffer-substring (match-beginning N) (match-end N))) |
17493 | 1518 expanded)))) |
1519 (setq pos (1+ pos))) | |
1520 (if did-expand | |
1521 (apply 'concat (nreverse expanded)) | |
1522 newtext))) | |
1523 | |
1524 ;; Activate a backend only if it isn't already activated. | |
1525 ;; If FORCE, re-read the active file even if the backend is | |
1526 ;; already activated. | |
1527 (defun nnmail-activate (backend &optional force) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
1528 (nnheader-init-server-buffer) |
17493 | 1529 (let (file timestamp file-time) |
1530 (if (or (not (symbol-value (intern (format "%s-group-alist" backend)))) | |
1531 force | |
1532 (and (setq file (ignore-errors | |
1533 (symbol-value (intern (format "%s-active-file" | |
1534 backend))))) | |
1535 (setq file-time (nth 5 (file-attributes file))) | |
1536 (or (not | |
1537 (setq timestamp | |
1538 (condition-case () | |
1539 (symbol-value (intern | |
1540 (format "%s-active-timestamp" | |
1541 backend))) | |
1542 (error 'none)))) | |
1543 (not (consp timestamp)) | |
1544 (equal timestamp '(0 0)) | |
1545 (> (nth 0 file-time) (nth 0 timestamp)) | |
1546 (and (= (nth 0 file-time) (nth 0 timestamp)) | |
1547 (> (nth 1 file-time) (nth 1 timestamp)))))) | |
1548 (save-excursion | |
1549 (or (eq timestamp 'none) | |
1550 (set (intern (format "%s-active-timestamp" backend)) | |
1551 file-time)) | |
1552 (funcall (intern (format "%s-request-list" backend))))) | |
1553 t)) | |
1554 | |
1555 (defun nnmail-message-id () | |
1556 (concat "<" (message-unique-id) "@totally-fudged-out-message-id>")) | |
1557 | |
1558 ;;; | |
1559 ;;; nnmail duplicate handling | |
1560 ;;; | |
1561 | |
1562 (defvar nnmail-cache-buffer nil) | |
1563 | |
1564 (defun nnmail-cache-open () | |
1565 (if (or (not nnmail-treat-duplicates) | |
1566 (and nnmail-cache-buffer | |
1567 (buffer-name nnmail-cache-buffer))) | |
1568 () ; The buffer is open. | |
1569 (save-excursion | |
1570 (set-buffer | |
1571 (setq nnmail-cache-buffer | |
1572 (get-buffer-create " *nnmail message-id cache*"))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1573 (gnus-add-buffer) |
17493 | 1574 (when (file-exists-p nnmail-message-id-cache-file) |
1575 (nnheader-insert-file-contents nnmail-message-id-cache-file)) | |
1576 (set-buffer-modified-p nil) | |
1577 (current-buffer)))) | |
1578 | |
1579 (defun nnmail-cache-close () | |
1580 (when (and nnmail-cache-buffer | |
1581 nnmail-treat-duplicates | |
1582 (buffer-name nnmail-cache-buffer) | |
1583 (buffer-modified-p nnmail-cache-buffer)) | |
1584 (save-excursion | |
1585 (set-buffer nnmail-cache-buffer) | |
1586 ;; Weed out the excess number of Message-IDs. | |
1587 (goto-char (point-max)) | |
1588 (when (search-backward "\n" nil t nnmail-message-id-cache-length) | |
1589 (progn | |
1590 (beginning-of-line) | |
1591 (delete-region (point-min) (point)))) | |
1592 ;; Save the buffer. | |
1593 (or (file-exists-p (file-name-directory nnmail-message-id-cache-file)) | |
1594 (make-directory (file-name-directory nnmail-message-id-cache-file) | |
1595 t)) | |
1596 (nnmail-write-region (point-min) (point-max) | |
1597 nnmail-message-id-cache-file nil 'silent) | |
1598 (set-buffer-modified-p nil) | |
1599 (setq nnmail-cache-buffer nil) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1600 (gnus-kill-buffer (current-buffer))))) |
17493 | 1601 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1602 ;; Compiler directives. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1603 (defvar group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1604 (defvar group-art-list) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1605 (defvar group-art) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1606 (defun nnmail-cache-insert (id grp &optional subject sender) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1607 (when (stringp id) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1608 ;; this will handle cases like `B r' where the group is nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1609 (let ((grp (or grp gnus-newsgroup-name "UNKNOWN"))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
1610 (run-hook-with-args 'nnmail-spool-hook |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1611 id grp subject sender)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1612 (when nnmail-treat-duplicates |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1613 ;; Store some information about the group this message is written |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1614 ;; to. This is passed in as the grp argument -- all locations this |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1615 ;; has been called from have been checked and the group is available. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1616 ;; The only ambiguous case is nnmail-check-duplication which will only |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1617 ;; pass the first (of possibly >1) group which matches. -Josh |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1618 (unless (gnus-buffer-live-p nnmail-cache-buffer) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1619 (nnmail-cache-open)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1620 (save-excursion |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1621 (set-buffer nnmail-cache-buffer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1622 (goto-char (point-max)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1623 (if (and grp (not (string= "" grp)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1624 (gnus-methods-equal-p gnus-command-method |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1625 (nnmail-cache-primary-mail-backend))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1626 (let ((regexp (if (consp nnmail-cache-ignore-groups) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1627 (mapconcat 'identity nnmail-cache-ignore-groups |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1628 "\\|") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1629 nnmail-cache-ignore-groups))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1630 (unless (and regexp (string-match regexp grp)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1631 (insert id "\t" grp "\n"))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1632 (insert id "\n")))))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58835
diff
changeset
|
1633 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1634 (defun nnmail-cache-primary-mail-backend () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1635 (let ((be-list (cons gnus-select-method gnus-secondary-select-methods)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1636 (be nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1637 (res nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1638 (get-new-mail nil)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1639 (while (and (null res) be-list) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1640 (setq be (car be-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1641 (setq be-list (cdr be-list)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1642 (when (and (gnus-method-option-p be 'respool) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1643 (setq get-new-mail |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1644 (intern (format "%s-get-new-mail" (car be)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1645 (boundp get-new-mail) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1646 (symbol-value get-new-mail)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1647 (setq res be))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1648 res)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1649 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1650 ;; Fetch the group name corresponding to the message id stored in the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1651 ;; cache. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1652 (defun nnmail-cache-fetch-group (id) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1653 (when (and nnmail-treat-duplicates nnmail-cache-buffer) |
17493 | 1654 (save-excursion |
1655 (set-buffer nnmail-cache-buffer) | |
1656 (goto-char (point-max)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1657 (when (search-backward id nil t) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1658 (beginning-of-line) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1659 (skip-chars-forward "^\n\r\t") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1660 (unless (looking-at "[\r\n]") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1661 (forward-char 1) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1662 (buffer-substring (point) (point-at-eol))))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1663 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1664 ;; Function for nnmail-split-fancy: look up all references in the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1665 ;; cache and if a match is found, return that group. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1666 (defun nnmail-split-fancy-with-parent () |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1667 "Split this message into the same group as its parent. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1668 This function can be used as an entry in `nnmail-split-fancy', for |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1669 example like this: (: nnmail-split-fancy-with-parent) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1670 For a message to be split, it looks for the parent message in the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1671 References or In-Reply-To header and then looks in the message id |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1672 cache file (given by the variable `nnmail-message-id-cache-file') to |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1673 see which group that message was put in. This group is returned. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1674 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1675 See the Info node `(gnus)Fancy Mail Splitting' for more details." |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1676 (let* ((refstr (or (message-fetch-field "references") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1677 (message-fetch-field "in-reply-to"))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1678 (references nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1679 (res nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1680 (regexp (if (consp nnmail-split-fancy-with-parent-ignore-groups) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1681 (mapconcat |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1682 (lambda (x) (format "\\(%s\\)" x)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1683 nnmail-split-fancy-with-parent-ignore-groups |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1684 "\\|") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1685 nnmail-split-fancy-with-parent-ignore-groups))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1686 (when refstr |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1687 (setq references (nreverse (gnus-split-references refstr))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1688 (unless (gnus-buffer-live-p nnmail-cache-buffer) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1689 (nnmail-cache-open)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1690 (dolist (x references) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1691 (setq res (or (nnmail-cache-fetch-group x) res)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1692 (when (or (member res '("delayed" "drafts" "queue")) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1693 (and regexp res (string-match regexp res))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1694 (setq res nil))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1695 res))) |
17493 | 1696 |
1697 (defun nnmail-cache-id-exists-p (id) | |
1698 (when nnmail-treat-duplicates | |
1699 (save-excursion | |
1700 (set-buffer nnmail-cache-buffer) | |
1701 (goto-char (point-max)) | |
1702 (search-backward id nil t)))) | |
1703 | |
1704 (defun nnmail-fetch-field (header) | |
1705 (save-excursion | |
1706 (save-restriction | |
1707 (message-narrow-to-head) | |
1708 (message-fetch-field header)))) | |
1709 | |
1710 (defun nnmail-check-duplication (message-id func artnum-func) | |
1711 (run-hooks 'nnmail-prepare-incoming-message-hook) | |
1712 ;; If this is a duplicate message, then we do not save it. | |
1713 (let* ((duplication (nnmail-cache-id-exists-p message-id)) | |
1714 (case-fold-search t) | |
1715 (action (when duplication | |
1716 (cond | |
1717 ((memq nnmail-treat-duplicates '(warn delete)) | |
1718 nnmail-treat-duplicates) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1719 ((functionp nnmail-treat-duplicates) |
17493 | 1720 (funcall nnmail-treat-duplicates message-id)) |
1721 (t | |
1722 nnmail-treat-duplicates)))) | |
1723 group-art) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1724 ;; We insert a line that says what the mail source is. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1725 (let ((case-fold-search t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1726 (goto-char (point-min)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1727 (re-search-forward "^message-id[ \t]*:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1728 (beginning-of-line) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1729 (insert (format "X-Gnus-Mail-Source: %s\n" mail-source-string))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1730 |
17493 | 1731 ;; Let the backend save the article (or not). |
1732 (cond | |
1733 ((not duplication) | |
1734 (funcall func (setq group-art | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1735 (nreverse (nnmail-article-group artnum-func)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1736 (nnmail-cache-insert message-id (caar group-art))) |
17493 | 1737 ((eq action 'delete) |
1738 (setq group-art nil)) | |
1739 ((eq action 'warn) | |
1740 ;; We insert a warning. | |
1741 (let ((case-fold-search t)) | |
1742 (goto-char (point-min)) | |
1743 (re-search-forward "^message-id[ \t]*:" nil t) | |
1744 (beginning-of-line) | |
1745 (insert | |
1746 "Gnus-Warning: This is a duplicate of message " message-id "\n") | |
1747 (funcall func (setq group-art | |
1748 (nreverse (nnmail-article-group artnum-func)))))) | |
1749 (t | |
1750 (funcall func (setq group-art | |
1751 (nreverse (nnmail-article-group artnum-func)))))) | |
1752 ;; Add the group-art list to the history list. | |
1753 (if group-art | |
1754 (push group-art nnmail-split-history) | |
1755 (delete-region (point-min) (point-max))))) | |
1756 | |
1757 ;;; Get new mail. | |
1758 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1759 (defvar nnmail-fetched-sources nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1760 |
17493 | 1761 (defun nnmail-get-value (&rest args) |
1762 (let ((sym (intern (apply 'format args)))) | |
1763 (when (boundp sym) | |
1764 (symbol-value sym)))) | |
1765 | |
1766 (defun nnmail-get-new-mail (method exit-func temp | |
88045 | 1767 &optional group spool-func) |
17493 | 1768 "Read new incoming mail." |
88045 | 1769 (nnmail-get-new-mail-1 method exit-func temp group nil spool-func)) |
1770 | |
1771 (defun nnmail-get-new-mail-1 (method exit-func temp | |
1772 group in-group spool-func) | |
87097 | 1773 (let* ((sources mail-sources) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1774 fetching-sources |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1775 (i 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1776 (new 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1777 (total 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1778 incoming incomings source) |
31785 | 1779 (when (and (nnmail-get-value "%s-get-new-mail" method) |
1780 sources) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1781 (while (setq source (pop sources)) |
88045 | 1782 ;; Use group's parameter |
1783 (when (eq (car source) 'group) | |
1784 (let ((mail-sources | |
1785 (list | |
1786 (gnus-group-find-parameter | |
1787 (concat (symbol-name method) ":" group) | |
1788 'mail-source t)))) | |
1789 (nnmail-get-new-mail-1 method exit-func temp | |
1790 group group spool-func)) | |
1791 (setq source nil)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1792 ;; Hack to only fetch the contents of a single group's spool file. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1793 (when (and (eq (car source) 'directory) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1794 (null nnmail-scan-directory-mail-source-once) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1795 group) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1796 (mail-source-bind (directory source) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1797 (setq source (append source |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1798 (list |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1799 :predicate |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1800 (gnus-byte-compile |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1801 `(lambda (file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1802 (string-equal |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1803 ,(concat group suffix) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1804 (file-name-nondirectory file))))))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1805 (when nnmail-fetched-sources |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1806 (if (member source nnmail-fetched-sources) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1807 (setq source nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1808 (push source nnmail-fetched-sources) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1809 (push source fetching-sources))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1810 (when fetching-sources |
17493 | 1811 ;; We first activate all the groups. |
1812 (nnmail-activate method) | |
1813 ;; Allow the user to hook. | |
1814 (run-hooks 'nnmail-pre-get-new-mail-hook) | |
1815 ;; Open the message-id cache. | |
1816 (nnmail-cache-open) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1817 ;; The we go through all the existing mail source specification |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1818 ;; and fetch the mail from each. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1819 (while (setq source (pop fetching-sources)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1820 (nnheader-message 4 "%s: Reading incoming mail from %s..." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1821 method (car source)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1822 (when (setq new |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1823 (mail-source-fetch |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1824 source |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1825 (gnus-byte-compile |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1826 `(lambda (file orig-file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1827 (nnmail-split-incoming |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1828 file ',(intern (format "%s-save-mail" method)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1829 ',spool-func |
88045 | 1830 (or in-group |
1831 (if (equal file orig-file) | |
1832 nil | |
1833 (nnmail-get-split-group orig-file ',source))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1834 ',(intern (format "%s-active-number" method))))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1835 (incf total new) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1836 (incf i))) |
17493 | 1837 ;; If we did indeed read any incoming spools, we save all info. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1838 (if (zerop total) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1839 (nnheader-message 4 "%s: Reading incoming mail (no new mail)...done" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1840 method (car source)) |
17493 | 1841 (nnmail-save-active |
1842 (nnmail-get-value "%s-group-alist" method) | |
1843 (nnmail-get-value "%s-active-file" method)) | |
1844 (when exit-func | |
1845 (funcall exit-func)) | |
1846 (run-hooks 'nnmail-read-incoming-hook) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1847 (nnheader-message 4 "%s: Reading incoming mail (%d new)...done" method |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1848 total)) |
17493 | 1849 ;; Close the message-id cache. |
1850 (nnmail-cache-close) | |
1851 ;; Allow the user to hook. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1852 (run-hooks 'nnmail-post-get-new-mail-hook)))) |
17493 | 1853 |
1854 (defun nnmail-expired-article-p (group time force &optional inhibit) | |
1855 "Say whether an article that is TIME old in GROUP should be expired." | |
1856 (if force | |
1857 t | |
1858 (let ((days (or (and nnmail-expiry-wait-function | |
1859 (funcall nnmail-expiry-wait-function group)) | |
1860 nnmail-expiry-wait))) | |
1861 (cond ((or (eq days 'never) | |
1862 (and (not force) | |
1863 inhibit)) | |
1864 ;; This isn't an expirable group. | |
1865 nil) | |
1866 ((eq days 'immediate) | |
1867 ;; We expire all articles on sight. | |
1868 t) | |
1869 ((equal time '(0 0)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1870 ;; This is an ange-ftp group, and we don't have any dates. |
17493 | 1871 nil) |
1872 ((numberp days) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1873 (setq days (days-to-time days)) |
17493 | 1874 ;; Compare the time with the current time. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1875 (ignore-errors (time-less-p days (time-since time)))))))) |
17493 | 1876 |
87232
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
1877 (declare-function gnus-group-mark-article-read "gnus-group" (group article)) |
0f083156a012
Add declare-function compatibility definition.
Glenn Morris <rgm@gnu.org>
parents:
87097
diff
changeset
|
1878 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1879 (defun nnmail-expiry-target-group (target group) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1880 ;; Do not invoke this from nntp-server-buffer! At least nnfolder clears |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1881 ;; that buffer if the nnfolder group isn't selected. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1882 (let (nnmail-cache-accepted-message-ids) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1883 ;; Don't enter Message-IDs into cache. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1884 ;; Let users hack it in TARGET function. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1885 (when (functionp target) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1886 (setq target (funcall target group))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1887 (unless (eq target 'delete) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1888 (when (or (gnus-request-group target) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1889 (gnus-request-create-group target)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1890 (let ((group-art (gnus-request-accept-article target nil nil t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1891 (when (consp group-art) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1892 (gnus-group-mark-article-read target (cdr group-art)))))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1893 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1894 (defun nnmail-fancy-expiry-target (group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1895 "Returns a target expiry group determined by `nnmail-fancy-expiry-targets'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1896 (let* (header |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1897 (case-fold-search nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1898 (from (or (message-fetch-field "from") "")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1899 (to (or (message-fetch-field "to") "")) |
67418
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1900 (date (message-fetch-field "date")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1901 (target 'delete)) |
67418
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1902 (setq date (if date |
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1903 (condition-case err |
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1904 (date-to-time date) |
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1905 (error |
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1906 (message "%s" (error-message-string err)) |
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1907 (current-time))) |
28264c86d408
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668
Miles Bader <miles@gnu.org>
parents:
65846
diff
changeset
|
1908 (current-time))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1909 (dolist (regexp-target-pair (reverse nnmail-fancy-expiry-targets) target) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1910 (setq header (car regexp-target-pair)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1911 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1912 ;; If the header is to-from then match against the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1913 ;; To or From header |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1914 ((and (equal header 'to-from) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1915 (or (string-match (cadr regexp-target-pair) from) |
79157 | 1916 (and (string-match (cadr regexp-target-pair) to) |
1917 (let ((rmail-dont-reply-to-names | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
1918 (message-dont-reply-to-names))) |
79157 | 1919 (equal (rmail-dont-reply-to from) ""))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1920 (setq target (format-time-string (caddr regexp-target-pair) date))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1921 ((and (not (equal header 'to-from)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1922 (string-match (cadr regexp-target-pair) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1923 (or |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1924 (message-fetch-field header) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1925 ""))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1926 (setq target |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1927 (format-time-string (caddr regexp-target-pair) date))))))) |
17493 | 1928 |
1929 (defun nnmail-check-syntax () | |
1930 "Check (and modify) the syntax of the message in the current buffer." | |
1931 (save-restriction | |
1932 (message-narrow-to-head) | |
1933 (let ((case-fold-search t)) | |
1934 (unless (re-search-forward "^Message-ID[ \t]*:" nil t) | |
1935 (insert "Message-ID: " (nnmail-message-id) "\n"))))) | |
1936 | |
1937 (defun nnmail-write-region (start end filename &optional append visit lockname) | |
1938 "Do a `write-region', and then set the file modes." | |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
1939 (let ((coding-system-for-write nnmail-file-coding-system) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1940 (file-name-coding-system nnmail-pathname-coding-system)) |
19593
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
1941 (write-region start end filename append visit lockname) |
6d421627bb8b
(nnmail-active-file-coding-system): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19522
diff
changeset
|
1942 (set-file-modes filename nnmail-default-file-modes))) |
17493 | 1943 |
1944 ;;; | |
1945 ;;; Status functions | |
1946 ;;; | |
1947 | |
1948 (defun nnmail-replace-status (name value) | |
1949 "Make status NAME and VALUE part of the current status line." | |
1950 (save-restriction | |
1951 (message-narrow-to-head) | |
1952 (let ((status (nnmail-decode-status))) | |
1953 (setq status (delq (member name status) status)) | |
1954 (when value | |
1955 (push (cons name value) status)) | |
1956 (message-remove-header "status") | |
1957 (goto-char (point-max)) | |
1958 (insert "Status: " (nnmail-encode-status status) "\n")))) | |
1959 | |
1960 (defun nnmail-decode-status () | |
1961 "Return a status-value alist from STATUS." | |
1962 (goto-char (point-min)) | |
1963 (when (re-search-forward "^Status: " nil t) | |
1964 (let (name value status) | |
1965 (save-restriction | |
1966 ;; Narrow to the status. | |
1967 (narrow-to-region | |
1968 (point) | |
1969 (if (re-search-forward "^[^ \t]" nil t) | |
1970 (1- (point)) | |
1971 (point-max))) | |
1972 ;; Go through all elements and add them to the list. | |
1973 (goto-char (point-min)) | |
1974 (while (re-search-forward "[^ \t=]+" nil t) | |
1975 (setq name (match-string 0)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1976 (if (not (eq (char-after) ?=)) |
17493 | 1977 ;; Implied "yes". |
1978 (setq value "yes") | |
1979 (forward-char 1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
1980 (if (not (eq (char-after) ?\")) |
17493 | 1981 (if (not (looking-at "[^ \t]")) |
1982 ;; Implied "no". | |
1983 (setq value "no") | |
1984 ;; Unquoted value. | |
1985 (setq value (match-string 0)) | |
1986 (goto-char (match-end 0))) | |
1987 ;; Quoted value. | |
1988 (setq value (read (current-buffer))))) | |
1989 (push (cons name value) status))) | |
1990 status))) | |
1991 | |
1992 (defun nnmail-encode-status (status) | |
1993 "Return a status string from STATUS." | |
1994 (mapconcat | |
1995 (lambda (elem) | |
1996 (concat | |
1997 (car elem) "=" | |
1998 (if (string-match "[ \t]" (cdr elem)) | |
1999 (prin1-to-string (cdr elem)) | |
2000 (cdr elem)))) | |
2001 status " ")) | |
2002 | |
2003 (defun nnmail-split-history () | |
2004 "Generate an overview of where the last mail split put articles." | |
2005 (interactive) | |
2006 (unless nnmail-split-history | |
2007 (error "No current split history")) | |
2008 (with-output-to-temp-buffer "*nnmail split history*" | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2009 (with-current-buffer standard-output |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
26039
diff
changeset
|
2010 (fundamental-mode)) ; for Emacs 20.4+ |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
2011 (dolist (elem nnmail-split-history) |
17493 | 2012 (princ (mapconcat (lambda (ga) |
2013 (concat (car ga) ":" (int-to-string (cdr ga)))) | |
2014 elem | |
2015 ", ")) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79157
diff
changeset
|
2016 (princ "\n")))) |
17493 | 2017 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2018 (defun nnmail-purge-split-history (group) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2019 "Remove all instances of GROUP from `nnmail-split-history'." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2020 (let ((history nnmail-split-history)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2021 (while history |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
2022 (setcar history (gnus-remove-if (lambda (e) (string= (car e) group)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2023 (car history))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2024 (pop history)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2025 (setq nnmail-split-history (delq nil nnmail-split-history)))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2026 |
17493 | 2027 (defun nnmail-new-mail-p (group) |
2028 "Say whether GROUP has new mail." | |
2029 (let ((his nnmail-split-history) | |
2030 found) | |
2031 (while his | |
2032 (when (assoc group (pop his)) | |
2033 (setq found t | |
2034 his nil))) | |
2035 found)) | |
2036 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2037 (defun nnmail-within-headers-p () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2038 "Check to see if point is within the headers of a unix mail message. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2039 Doesn't change point." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2040 (let ((pos (point))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2041 (save-excursion |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2042 (and (nnmail-search-unix-mail-delim-backward) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2043 (not (search-forward "\n\n" pos t)))))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19988
diff
changeset
|
2044 |
17493 | 2045 (run-hooks 'nnmail-load-hook) |
2046 | |
2047 (provide 'nnmail) | |
2048 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92336
diff
changeset
|
2049 ;; arch-tag: fe8f671a-50db-428a-bb5d-f00462f72ed7 |
17493 | 2050 ;;; nnmail.el ends here |