Mercurial > emacs
annotate lisp/gnus/nndoc.el @ 110539:257fdafa1a11
lisp/ChangeLog: Fix dates after merge.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 24 Sep 2010 05:23:07 +0200 |
parents | 93e093c035a0 |
children | b6d2a63ad993 |
rev | line source |
---|---|
17493 | 1 ;;; nndoc.el --- single file access for Gnus |
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, |
106815 | 4 ;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
7 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> |
17493 | 8 ;; Keywords: news |
9 | |
10 ;; This file is part of GNU Emacs. | |
11 | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92432
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
17493 | 13 ;; 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:
92432
diff
changeset
|
14 ;; 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:
92432
diff
changeset
|
15 ;; (at your option) any later version. |
17493 | 16 |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
92432
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
17493 | 24 |
25 ;;; Commentary: | |
26 | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
27 ;; For Outlook mail boxes format, see http://mbx2mbox.sourceforge.net/ |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
28 |
17493 | 29 ;;; Code: |
30 | |
31 (require 'nnheader) | |
32 (require 'message) | |
33 (require 'nnmail) | |
34 (require 'nnoo) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
35 (require 'gnus-util) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
36 (require 'mm-util) |
17493 | 37 (eval-when-compile (require 'cl)) |
38 | |
39 (nnoo-declare nndoc) | |
40 | |
41 (defvoo nndoc-article-type 'guess | |
42 "*Type of the file. | |
43 One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward', | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
44 `rfc934', `rfc822-forward', `mime-parts', `standard-digest', |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
45 `slack-digest', `clari-briefs', `nsmail', `outlook', `oe-dbx', |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
46 `mailman', `exim-bounce', or `guess'.") |
17493 | 47 |
48 (defvoo nndoc-post-type 'mail | |
49 "*Whether the nndoc group is `mail' or `post'.") | |
50 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
51 (defvoo nndoc-open-document-hook 'nnheader-ms-strip-cr |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
52 "Hook run after opening a document. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
53 The default function removes all trailing carriage returns |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
54 from the document.") |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
55 |
17493 | 56 (defvar nndoc-type-alist |
57 `((mmdf | |
58 (article-begin . "^\^A\^A\^A\^A\n") | |
59 (body-end . "^\^A\^A\^A\^A\n")) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
60 (mime-digest |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
61 (article-begin . "") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
62 (head-begin . "^ ?\n") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
63 (head-end . "^ ?$") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
64 (body-end . "") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
65 (file-end . "") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
66 (subtype digest guess)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
67 (mime-parts |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
68 (generate-head-function . nndoc-generate-mime-parts-head) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
69 (article-transform-function . nndoc-transform-mime-parts)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
70 (nsmail |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
71 (article-begin . "^From - ")) |
17493 | 72 (news |
73 (article-begin . "^Path:")) | |
74 (rnews | |
75 (article-begin . "^#! *rnews +\\([0-9]+\\) *\n") | |
76 (body-end-function . nndoc-rnews-body-end)) | |
77 (mbox | |
78 (article-begin-function . nndoc-mbox-article-begin) | |
79 (body-end-function . nndoc-mbox-body-end)) | |
80 (babyl | |
81 (article-begin . "\^_\^L *\n") | |
82 (body-end . "\^_") | |
83 (body-begin-function . nndoc-babyl-body-begin) | |
84 (head-begin-function . nndoc-babyl-head-begin)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
85 (exim-bounce |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
86 (article-begin . "^------ This is a copy of the message, including all the headers. ------\n\n") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
87 (body-end-function . nndoc-exim-bounce-body-end-function)) |
17493 | 88 (rfc934 |
89 (article-begin . "^--.*\n+") | |
90 (body-end . "^--.*$") | |
91 (prepare-body-function . nndoc-unquote-dashes)) | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
92 (mailman |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
93 (article-begin . "^--__--__--\n\nMessage:") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
94 (body-end . "^--__--__--$") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
95 (prepare-body-function . nndoc-unquote-dashes)) |
17493 | 96 (clari-briefs |
97 (article-begin . "^ \\*") | |
98 (body-end . "^\t------*[ \t]^*\n^ \\*") | |
99 (body-begin . "^\t") | |
100 (head-end . "^\t") | |
101 (generate-head-function . nndoc-generate-clari-briefs-head) | |
102 (article-transform-function . nndoc-transform-clari-briefs)) | |
110111
5b9f64b04a04
Delete all trailing white space.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110108
diff
changeset
|
103 |
17493 | 104 (standard-digest |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
105 (first-article . ,(concat "^" (make-string 70 ?-) "\n *\n+")) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
106 (article-begin . ,(concat "^\n" (make-string 30 ?-) "\n *\n+")) |
17493 | 107 (prepare-body-function . nndoc-unquote-dashes) |
108 (body-end-function . nndoc-digest-body-end) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
109 (head-end . "^ *$") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
110 (body-begin . "^ *\n") |
17493 | 111 (file-end . "^End of .*digest.*[0-9].*\n\\*\\*\\|^End of.*Digest *$") |
112 (subtype digest guess)) | |
113 (slack-digest | |
114 (article-begin . "^------------------------------*[\n \t]+") | |
115 (head-end . "^ ?$") | |
116 (body-end-function . nndoc-digest-body-end) | |
117 (body-begin . "^ ?$") | |
118 (file-end . "^End of") | |
119 (prepare-body-function . nndoc-unquote-dashes) | |
120 (subtype digest guess)) | |
110108
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
121 (google |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
122 (pre-dissection-function . nndoc-decode-content-transfer-encoding) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
123 (article-begin . "^== [0-9]+ of [0-9]+ ==$") |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
124 (head-begin . "^Date:") |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
125 (head-end . "^$") |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
126 (body-end-function . nndoc-digest-body-end) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
127 (body-begin . "^$") |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
128 (file-end . "^==============================================================================$") |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
129 (prepare-body-function . nndoc-unquote-dashes) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
130 (subtype digest guess)) |
17493 | 131 (lanl-gov-announce |
132 (article-begin . "^\\\\\\\\\n") | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
133 (head-begin . "^\\(Paper.*:\\|arXiv:\\)") |
17493 | 134 (head-end . "\\(^\\\\\\\\.*\n\\|-----------------\\)") |
135 (body-begin . "") | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
136 (body-end . "\\(-------------------------------------------------\\|%-%-%-%-%-%-%-%-%-%-%-%-%-%-\\|%%--%%--%%--%%--%%--%%--%%--%%--\\|%%%---%%%---%%%---%%%---\\)") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
137 (file-end . "\\(^Title: Recent Seminal\\|%%%---%%%---%%%---%%%---\\)") |
17493 | 138 (generate-head-function . nndoc-generate-lanl-gov-head) |
139 (article-transform-function . nndoc-transform-lanl-gov-announce) | |
140 (subtype preprints guess)) | |
141 (rfc822-forward | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
142 (article-begin . "^\n+") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
143 (body-end-function . nndoc-rfc822-forward-body-end-function) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
144 (generate-head-function . nndoc-rfc822-forward-generate-head) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
145 (generate-article-function . nndoc-rfc822-forward-generate-article)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
146 (outlook |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
147 (article-begin-function . nndoc-outlook-article-begin) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
148 (body-end . "\0")) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
149 (oe-dbx ;; Outlook Express DBX format |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
150 (dissection-function . nndoc-oe-dbx-dissection) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
151 (generate-head-function . nndoc-oe-dbx-generate-head) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
152 (generate-article-function . nndoc-oe-dbx-generate-article)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
153 (forward |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
154 (article-begin . "^-+ \\(Start of \\)?forwarded message.*\n+") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
155 (body-end . "^-+ End \\(of \\)?forwarded message.*$") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
156 (prepare-body-function . nndoc-unquote-dashes)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
157 (mail-in-mail ;; Wild guess on mailer daemon's messages or others |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
158 (article-begin-function . nndoc-mail-in-mail-article-begin)) |
17493 | 159 (guess |
160 (guess . t) | |
161 (subtype nil)) | |
162 (digest | |
163 (guess . t) | |
164 (subtype nil)) | |
165 (preprints | |
166 (guess . t) | |
167 (subtype nil)))) | |
168 | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
169 (defvar nndoc-binary-file-names ".[Dd][Bb][Xx]$" |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
170 "Regexp for binary nndoc file names.") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
171 |
17493 | 172 |
173 (defvoo nndoc-file-begin nil) | |
174 (defvoo nndoc-first-article nil) | |
175 (defvoo nndoc-article-begin nil) | |
176 (defvoo nndoc-head-begin nil) | |
177 (defvoo nndoc-head-end nil) | |
178 (defvoo nndoc-file-end nil) | |
179 (defvoo nndoc-body-begin nil) | |
180 (defvoo nndoc-body-end-function nil) | |
181 (defvoo nndoc-body-begin-function nil) | |
182 (defvoo nndoc-head-begin-function nil) | |
183 (defvoo nndoc-body-end nil) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
184 ;; nndoc-dissection-alist is a list of sublists. Each sublist holds the |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
185 ;; following items. ARTICLE acts as the association key and is an ordinal |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
186 ;; starting at 1. HEAD-BEGIN [0], HEAD-END [1], BODY-BEGIN [2] and BODY-END |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
187 ;; [3] are positions in the `nndoc' buffer. LINE-COUNT [4] is a count of |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
188 ;; lines in the body. For MIME dissections only, ARTICLE-INSERT [5] and |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
189 ;; SUMMARY-INSERT [6] give headers to insert for full article or summary line |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
190 ;; generation, respectively. Other headers usually follow directly from the |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
191 ;; buffer. Value `nil' means no insert. |
17493 | 192 (defvoo nndoc-dissection-alist nil) |
193 (defvoo nndoc-prepare-body-function nil) | |
194 (defvoo nndoc-generate-head-function nil) | |
195 (defvoo nndoc-article-transform-function nil) | |
196 (defvoo nndoc-article-begin-function nil) | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
197 (defvoo nndoc-generate-article-function nil) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
198 (defvoo nndoc-dissection-function nil) |
110108
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
199 (defvoo nndoc-pre-dissection-function nil) |
17493 | 200 |
201 (defvoo nndoc-status-string "") | |
202 (defvoo nndoc-group-alist nil) | |
203 (defvoo nndoc-current-buffer nil | |
204 "Current nndoc news buffer.") | |
205 (defvoo nndoc-address nil) | |
206 | |
207 (defconst nndoc-version "nndoc 1.0" | |
208 "nndoc version.") | |
209 | |
210 | |
211 | |
212 ;;; Interface functions | |
213 | |
214 (nnoo-define-basics nndoc) | |
215 | |
216 (deffoo nndoc-retrieve-headers (articles &optional newsgroup server fetch-old) | |
217 (when (nndoc-possibly-change-buffer newsgroup server) | |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110111
diff
changeset
|
218 (with-current-buffer nntp-server-buffer |
17493 | 219 (erase-buffer) |
220 (let (article entry) | |
221 (if (stringp (car articles)) | |
222 'headers | |
223 (while articles | |
224 (when (setq entry (cdr (assq (setq article (pop articles)) | |
225 nndoc-dissection-alist))) | |
226 (insert (format "221 %d Article retrieved.\n" article)) | |
227 (if nndoc-generate-head-function | |
228 (funcall nndoc-generate-head-function article) | |
229 (insert-buffer-substring | |
230 nndoc-current-buffer (car entry) (nth 1 entry))) | |
231 (goto-char (point-max)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
232 (unless (eq (char-after (1- (point))) ?\n) |
17493 | 233 (insert "\n")) |
234 (insert (format "Lines: %d\n" (nth 4 entry))) | |
235 (insert ".\n"))) | |
236 | |
237 (nnheader-fold-continuation-lines) | |
238 'headers))))) | |
239 | |
240 (deffoo nndoc-request-article (article &optional newsgroup server buffer) | |
241 (nndoc-possibly-change-buffer newsgroup server) | |
242 (save-excursion | |
243 (let ((buffer (or buffer nntp-server-buffer)) | |
244 (entry (cdr (assq article nndoc-dissection-alist))) | |
245 beg) | |
246 (set-buffer buffer) | |
247 (erase-buffer) | |
248 (when entry | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
249 (cond |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
250 ((stringp article) nil) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
251 (nndoc-generate-article-function |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
252 (funcall nndoc-generate-article-function article)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
253 (t |
17493 | 254 (insert-buffer-substring |
255 nndoc-current-buffer (car entry) (nth 1 entry)) | |
256 (insert "\n") | |
257 (setq beg (point)) | |
258 (insert-buffer-substring | |
259 nndoc-current-buffer (nth 2 entry) (nth 3 entry)) | |
260 (goto-char beg) | |
261 (when nndoc-prepare-body-function | |
262 (funcall nndoc-prepare-body-function)) | |
263 (when nndoc-article-transform-function | |
264 (funcall nndoc-article-transform-function article)) | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
265 t)))))) |
17493 | 266 |
110422
93e093c035a0
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110410
diff
changeset
|
267 (deffoo nndoc-request-group (group &optional server dont-check info) |
17493 | 268 "Select news GROUP." |
269 (let (number) | |
270 (cond | |
271 ((not (nndoc-possibly-change-buffer group server)) | |
272 (nnheader-report 'nndoc "No such file or buffer: %s" | |
273 nndoc-address)) | |
274 (dont-check | |
275 (nnheader-report 'nndoc "Selected group %s" group) | |
276 t) | |
277 ((zerop (setq number (length nndoc-dissection-alist))) | |
278 (nndoc-close-group group) | |
279 (nnheader-report 'nndoc "No articles in group %s" group)) | |
280 (t | |
281 (nnheader-insert "211 %d %d %d %s\n" number 1 number group))))) | |
282 | |
283 (deffoo nndoc-request-type (group &optional article) | |
284 (cond ((not article) 'unknown) | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
285 (nndoc-post-type nndoc-post-type) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
286 (t 'unknown))) |
17493 | 287 |
288 (deffoo nndoc-close-group (group &optional server) | |
289 (nndoc-possibly-change-buffer group server) | |
290 (and nndoc-current-buffer | |
291 (buffer-name nndoc-current-buffer) | |
292 (kill-buffer nndoc-current-buffer)) | |
293 (setq nndoc-group-alist (delq (assoc group nndoc-group-alist) | |
294 nndoc-group-alist)) | |
295 (setq nndoc-current-buffer nil) | |
296 (nnoo-close-server 'nndoc server) | |
297 (setq nndoc-dissection-alist nil) | |
298 t) | |
299 | |
300 (deffoo nndoc-request-list (&optional server) | |
301 nil) | |
302 | |
303 (deffoo nndoc-request-newgroups (date &optional server) | |
304 nil) | |
305 | |
306 (deffoo nndoc-request-list-newsgroups (&optional server) | |
307 nil) | |
308 | |
309 | |
310 ;;; Internal functions. | |
311 | |
312 (defun nndoc-possibly-change-buffer (group source) | |
313 (let (buf) | |
314 (cond | |
315 ;; The current buffer is this group's buffer. | |
316 ((and nndoc-current-buffer | |
317 (buffer-name nndoc-current-buffer) | |
318 (eq nndoc-current-buffer | |
319 (setq buf (cdr (assoc group nndoc-group-alist)))))) | |
320 ;; We change buffers by taking an old from the group alist. | |
321 ;; `source' is either a string (a file name) or a buffer object. | |
322 (buf | |
323 (setq nndoc-current-buffer buf)) | |
324 ;; It's a totally new group. | |
325 ((or (and (bufferp nndoc-address) | |
326 (buffer-name nndoc-address)) | |
327 (and (stringp nndoc-address) | |
328 (file-exists-p nndoc-address) | |
329 (not (file-directory-p nndoc-address)))) | |
330 (push (cons group (setq nndoc-current-buffer | |
331 (get-buffer-create | |
332 (concat " *nndoc " group "*")))) | |
333 nndoc-group-alist) | |
334 (setq nndoc-dissection-alist nil) | |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110111
diff
changeset
|
335 (with-current-buffer nndoc-current-buffer |
17493 | 336 (erase-buffer) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
337 (if (and (stringp nndoc-address) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
338 (string-match nndoc-binary-file-names nndoc-address)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
339 (let ((coding-system-for-read 'binary)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
340 (mm-insert-file-contents nndoc-address)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
341 (if (stringp nndoc-address) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
342 (nnheader-insert-file-contents nndoc-address) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
343 (insert-buffer-substring nndoc-address)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
344 (run-hooks 'nndoc-open-document-hook))))) |
17493 | 345 ;; Initialize the nndoc structures according to this new document. |
346 (when (and nndoc-current-buffer | |
347 (not nndoc-dissection-alist)) | |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110111
diff
changeset
|
348 (with-current-buffer nndoc-current-buffer |
17493 | 349 (nndoc-set-delims) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
350 (if (eq nndoc-article-type 'mime-parts) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
351 (nndoc-dissect-mime-parts) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
352 (nndoc-dissect-buffer)))) |
17493 | 353 (unless nndoc-current-buffer |
354 (nndoc-close-server)) | |
355 ;; Return whether we managed to select a file. | |
356 nndoc-current-buffer)) | |
357 | |
358 ;;; | |
359 ;;; Deciding what document type we have | |
360 ;;; | |
361 | |
362 (defun nndoc-set-delims () | |
363 "Set the nndoc delimiter variables according to the type of the document." | |
364 (let ((vars '(nndoc-file-begin | |
365 nndoc-first-article | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
366 nndoc-article-begin-function |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
367 nndoc-head-begin nndoc-head-end |
17493 | 368 nndoc-file-end nndoc-article-begin |
369 nndoc-body-begin nndoc-body-end-function nndoc-body-end | |
370 nndoc-prepare-body-function nndoc-article-transform-function | |
371 nndoc-generate-head-function nndoc-body-begin-function | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
372 nndoc-head-begin-function |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
373 nndoc-generate-article-function |
110108
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
374 nndoc-dissection-function |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
375 nndoc-pre-dissection-function))) |
17493 | 376 (while vars |
377 (set (pop vars) nil))) | |
378 (let (defs) | |
379 ;; Guess away until we find the real file type. | |
380 (while (assq 'guess (setq defs (cdr (assq nndoc-article-type | |
381 nndoc-type-alist)))) | |
382 (setq nndoc-article-type (nndoc-guess-type nndoc-article-type))) | |
383 ;; Set the nndoc variables. | |
384 (while defs | |
385 (set (intern (format "nndoc-%s" (caar defs))) | |
386 (cdr (pop defs)))))) | |
387 | |
388 (defun nndoc-guess-type (subtype) | |
389 (let ((alist nndoc-type-alist) | |
390 results result entry) | |
391 (while (and (not result) | |
392 (setq entry (pop alist))) | |
393 (when (memq subtype (or (cdr (assq 'subtype entry)) '(guess))) | |
394 (goto-char (point-min)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
395 ;; Remove blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
396 (while (eq (following-char) ?\n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
397 (delete-char 1)) |
17493 | 398 (when (numberp (setq result (funcall (intern |
399 (format "nndoc-%s-type-p" | |
400 (car entry)))))) | |
401 (push (cons result entry) results) | |
402 (setq result nil)))) | |
403 (unless (or result results) | |
404 (error "Document is not of any recognized type")) | |
405 (if result | |
406 (car entry) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
407 (cadar (last (sort results 'car-less-than-car)))))) |
17493 | 408 |
409 ;;; | |
410 ;;; Built-in type predicates and functions | |
411 ;;; | |
412 | |
413 (defun nndoc-mbox-type-p () | |
414 (when (looking-at message-unix-mail-delimiter) | |
415 t)) | |
416 | |
417 (defun nndoc-mbox-article-begin () | |
418 (when (re-search-forward (concat "^" message-unix-mail-delimiter) nil t) | |
419 (goto-char (match-beginning 0)))) | |
420 | |
421 (defun nndoc-mbox-body-end () | |
422 (let ((beg (point)) | |
423 len end) | |
424 (when | |
425 (save-excursion | |
426 (and (re-search-backward | |
427 (concat "^" message-unix-mail-delimiter) nil t) | |
428 (setq end (point)) | |
429 (search-forward "\n\n" beg t) | |
430 (re-search-backward | |
431 "^Content-Length:[ \t]*\\([0-9]+\\) *$" end t) | |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
432 (setq len (string-to-number (match-string 1))) |
17493 | 433 (search-forward "\n\n" beg t) |
434 (unless (= (setq len (+ (point) len)) (point-max)) | |
435 (and (< len (point-max)) | |
436 (goto-char len) | |
437 (looking-at message-unix-mail-delimiter))))) | |
438 (goto-char len)))) | |
439 | |
440 (defun nndoc-mmdf-type-p () | |
441 (when (looking-at "\^A\^A\^A\^A$") | |
442 t)) | |
443 | |
444 (defun nndoc-news-type-p () | |
445 (when (looking-at "^Path:.*\n") | |
446 t)) | |
447 | |
448 (defun nndoc-rnews-type-p () | |
449 (when (looking-at "#! *rnews") | |
450 t)) | |
451 | |
452 (defun nndoc-rnews-body-end () | |
453 (and (re-search-backward nndoc-article-begin nil t) | |
454 (forward-line 1) | |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
455 (goto-char (+ (point) (string-to-number (match-string 1)))))) |
17493 | 456 |
110108
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
457 (defun nndoc-google-type-p () |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
458 (when (re-search-forward "^=3D=3D 1 of [0-9]+ =3D=3D$" nil t) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
459 t)) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
460 |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
461 (defun nndoc-decode-content-transfer-encoding () |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
462 (let ((encoding |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
463 (save-restriction |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
464 (message-narrow-to-head) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
465 (message-fetch-field "content-transfer-encoding")))) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
466 (when (and encoding |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
467 (search-forward "\n\n" nil t)) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
468 (save-restriction |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
469 (narrow-to-region (point) (point-max)) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
470 (mm-decode-content-transfer-encoding |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
471 (intern (downcase (mail-header-strip encoding)))))))) |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
472 |
17493 | 473 (defun nndoc-babyl-type-p () |
474 (when (re-search-forward "\^_\^L *\n" nil t) | |
475 t)) | |
476 | |
477 (defun nndoc-babyl-body-begin () | |
478 (re-search-forward "^\n" nil t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
479 (when (looking-at "\\*\\*\\* EOOH \\*\\*\\*") |
17493 | 480 (let ((next (or (save-excursion |
481 (re-search-forward nndoc-article-begin nil t)) | |
482 (point-max)))) | |
483 (unless (re-search-forward "^\n" next t) | |
484 (goto-char next) | |
485 (forward-line -1) | |
486 (insert "\n") | |
487 (forward-line -1))))) | |
488 | |
489 (defun nndoc-babyl-head-begin () | |
490 (when (re-search-forward "^[0-9].*\n" nil t) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
491 (when (looking-at "\\*\\*\\* EOOH \\*\\*\\*") |
17493 | 492 (forward-line 1)) |
493 t)) | |
494 | |
495 (defun nndoc-forward-type-p () | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
496 (when (and (re-search-forward "^-+ \\(Start of \\)?forwarded message.*\n+" |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
497 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
|
498 (looking-at "[\r\n]*[a-zA-Z][a-zA-Z0-9-]*:\\|^>?From ")) |
17493 | 499 t)) |
500 | |
501 (defun nndoc-rfc934-type-p () | |
502 (when (and (re-search-forward "^-+ Start of forwarded.*\n+" nil t) | |
503 (not (re-search-forward "^Subject:.*digest" nil t)) | |
504 (not (re-search-backward "^From:" nil t 2)) | |
505 (not (re-search-forward "^From:" nil t 2))) | |
506 t)) | |
507 | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
508 (defun nndoc-mailman-type-p () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
509 (when (re-search-forward "^--__--__--\n+" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
510 t)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
511 |
17493 | 512 (defun nndoc-rfc822-forward-type-p () |
513 (save-restriction | |
514 (message-narrow-to-head) | |
515 (when (re-search-forward "^Content-Type: *message/rfc822" nil t) | |
516 t))) | |
517 | |
518 (defun nndoc-rfc822-forward-body-end-function () | |
519 (goto-char (point-max))) | |
520 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
521 (defun nndoc-rfc822-forward-generate-article (article &optional head) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
522 (let ((entry (cdr (assq article nndoc-dissection-alist))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
523 (begin (point)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
524 encoding) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
525 (with-current-buffer nndoc-current-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
526 (save-restriction |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
527 (message-narrow-to-head) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
528 (setq encoding (message-fetch-field "content-transfer-encoding")))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
529 (insert-buffer-substring nndoc-current-buffer (car entry) (nth 3 entry)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
530 (when encoding |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
531 (save-restriction |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
532 (narrow-to-region begin (point-max)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
533 (mm-decode-content-transfer-encoding |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
534 (intern (downcase (mail-header-strip encoding)))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
535 (when head |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
536 (goto-char begin) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
537 (when (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
|
538 (delete-region (1- (point)) (point-max))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
539 t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
540 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
541 (defun nndoc-rfc822-forward-generate-head (article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
542 (nndoc-rfc822-forward-generate-article article 'head)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
543 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
544 (defun nndoc-mime-parts-type-p () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
545 (let ((case-fold-search t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
546 (limit (search-forward "\n\n" nil t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
547 (goto-char (point-min)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
548 (when (and limit |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
549 (re-search-forward |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
550 (concat "\ |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
551 ^Content-Type:[ \t]*multipart/[a-z]+ *; *\\(\\(\n[ \t]\\)?.*;\\)*" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
552 "\\(\n[ \t]\\)?[ \t]*boundary=\"?[^\"\n]*[^\" \t\n]") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
553 limit t)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
554 t))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
555 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
556 (defun nndoc-transform-mime-parts (article) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
557 (let* ((entry (cdr (assq article nndoc-dissection-alist))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
558 (headers (nth 5 entry))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
559 (when headers |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
560 (goto-char (point-min)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
561 (insert headers)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
562 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
563 (defun nndoc-generate-mime-parts-head (article) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
564 (let* ((entry (cdr (assq article nndoc-dissection-alist))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
565 (headers (nth 6 entry))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
566 (save-restriction |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
567 (narrow-to-region (point) (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
568 (insert-buffer-substring |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
569 nndoc-current-buffer (car entry) (nth 1 entry)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
570 (goto-char (point-max))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
571 (when headers |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
572 (insert headers)))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
573 |
17493 | 574 (defun nndoc-clari-briefs-type-p () |
575 (when (let ((case-fold-search nil)) | |
576 (re-search-forward "^\t[^a-z]+ ([^a-z]+) --" nil t)) | |
577 t)) | |
578 | |
579 (defun nndoc-transform-clari-briefs (article) | |
580 (goto-char (point-min)) | |
581 (when (looking-at " *\\*\\(.*\\)\n") | |
582 (replace-match "" t t)) | |
583 (nndoc-generate-clari-briefs-head article)) | |
584 | |
585 (defun nndoc-generate-clari-briefs-head (article) | |
586 (let ((entry (cdr (assq article nndoc-dissection-alist))) | |
587 subject from) | |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110111
diff
changeset
|
588 (with-current-buffer nndoc-current-buffer |
17493 | 589 (save-restriction |
590 (narrow-to-region (car entry) (nth 3 entry)) | |
591 (goto-char (point-min)) | |
592 (when (looking-at " *\\*\\(.*\\)$") | |
593 (setq subject (match-string 1)) | |
594 (when (string-match "[ \t]+$" subject) | |
595 (setq subject (substring subject 0 (match-beginning 0))))) | |
596 (when | |
597 (let ((case-fold-search nil)) | |
598 (re-search-forward | |
599 "^\t\\([^a-z]+\\(,[^(]+\\)? ([^a-z]+)\\) --" nil t)) | |
600 (setq from (match-string 1))))) | |
601 (insert "From: " "clari@clari.net (" (or from "unknown") ")" | |
602 "\nSubject: " (or subject "(no subject)") "\n"))) | |
603 | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
604 (defun nndoc-exim-bounce-type-p () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
605 (and (re-search-forward "^------ This is a copy of the message, including all the headers. ------" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
606 t)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
607 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
608 (defun nndoc-exim-bounce-body-end-function () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
609 (goto-char (point-max))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
610 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
611 |
17493 | 612 (defun nndoc-mime-digest-type-p () |
613 (let ((case-fold-search t) | |
614 boundary-id b-delimiter entry) | |
615 (when (and | |
616 (re-search-forward | |
617 (concat "^Content-Type: *multipart/digest;[ \t\n]*[ \t]" | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
618 "boundary=\"?\\([^\"\n]*[^\" \t\n]\\)") |
17493 | 619 nil t) |
620 (match-beginning 1)) | |
621 (setq boundary-id (match-string 1) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
622 b-delimiter (concat "\n--" boundary-id "[ \t]*$")) |
17493 | 623 (setq entry (assq 'mime-digest nndoc-type-alist)) |
624 (setcdr entry | |
625 (list | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
626 (cons 'head-begin "^ ?\n") |
17493 | 627 (cons 'head-end "^ ?$") |
628 (cons 'body-begin "^ ?\n") | |
629 (cons 'article-begin b-delimiter) | |
630 (cons 'body-end-function 'nndoc-digest-body-end) | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
631 (cons 'file-end (concat "^--" boundary-id "--[ \t]*$")))) |
17493 | 632 t))) |
633 | |
634 (defun nndoc-standard-digest-type-p () | |
635 (when (and (re-search-forward (concat "^" (make-string 70 ?-) "\n\n") nil t) | |
636 (re-search-forward | |
637 (concat "\n\n" (make-string 30 ?-) "\n\n") nil t)) | |
638 t)) | |
639 | |
640 (defun nndoc-digest-body-end () | |
641 (and (re-search-forward nndoc-article-begin nil t) | |
642 (goto-char (match-beginning 0)))) | |
643 | |
644 (defun nndoc-slack-digest-type-p () | |
645 0) | |
646 | |
647 (defun nndoc-lanl-gov-announce-type-p () | |
648 (when (let ((case-fold-search nil)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
649 (re-search-forward "^\\\\\\\\\n\\(Paper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+\\|arXiv:\\)" nil t)) |
17493 | 650 t)) |
651 | |
652 (defun nndoc-transform-lanl-gov-announce (article) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
653 (let ((case-fold-search nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
654 (goto-char (point-max)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
655 (when (re-search-backward "^\\\\\\\\ +( *\\([^ ]*\\) , *\\([^ ]*\\))" nil t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
656 (replace-match "\n\nGet it at \\1 (\\2)" t nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
657 (goto-char (point-min)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
658 (while (re-search-forward "^\\\\\\\\$" nil t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
659 (replace-match "" t nil)) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
660 (goto-char (point-min)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
661 (when (re-search-forward "^replaced with revised version +\\(.*[^ ]\\) +" nil t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
662 (replace-match "Date: \\1 (revised) " t nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
663 (goto-char (point-min)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
664 (unless (re-search-forward "^From" nil t) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
665 (goto-char (point-min)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
666 (when (re-search-forward "^Authors?: \\(.*\\)" nil t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
667 (goto-char (point-min)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
668 (insert "From: " (match-string 1) "\n"))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
669 (when (re-search-forward "^arXiv:" nil t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
670 (replace-match "Paper: arXiv:" t nil)))) |
17493 | 671 |
672 (defun nndoc-generate-lanl-gov-head (article) | |
673 (let ((entry (cdr (assq article nndoc-dissection-alist))) | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
674 (from "<no address given>") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
675 subject date) |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110111
diff
changeset
|
676 (with-current-buffer nndoc-current-buffer |
17493 | 677 (save-restriction |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
678 (narrow-to-region (car entry) (nth 1 entry)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
679 (goto-char (point-min)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
680 (when (looking-at "^\\(Paper.*: \\|arXiv:\\)\\([0-9a-zA-Z-\\./]+\\)") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
681 (setq subject (concat " (" (match-string 2) ")")) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
682 (when (re-search-forward "^From: \\(.*\\)" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
683 (setq from (concat "<" |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
45957
diff
changeset
|
684 (cadr (funcall gnus-extract-address-components |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
685 (match-string 1))) ">"))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
686 (if (re-search-forward "^Date: +\\([^(]*\\)" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
687 (setq date (match-string 1)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
688 (when (re-search-forward "^replaced with revised version +\\([^(]*\\)" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
689 (setq date (match-string 1)))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
690 (when (re-search-forward "^Title: \\([^\f]*\\)\nAuthors?: \\(.*\\)" |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
691 nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
692 (setq subject (concat (match-string 1) subject)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
693 (setq from (concat (match-string 2) " " from)))))) |
17493 | 694 (while (and from (string-match "(\[^)\]*)" from)) |
695 (setq from (replace-match "" t t from))) | |
696 (insert "From: " (or from "unknown") | |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
697 "\nSubject: " (or subject "(no subject)") "\n") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
698 (if date (insert "Date: " date)))) |
17493 | 699 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
700 (defun nndoc-nsmail-type-p () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
701 (when (looking-at "From - ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
702 t)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
703 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
704 (defun nndoc-outlook-article-begin () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
705 (prog1 (re-search-forward "From:\\|Received:" nil t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
706 (goto-char (match-beginning 0)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
707 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
708 (defun nndoc-outlook-type-p () |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
709 ;; FIXME: Is JMF the magic of outlook mailbox? -- ShengHuo. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
710 (looking-at "JMF")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
711 |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
712 (defun nndoc-oe-dbx-type-p () |
92432
4fe0858e4c31
(nndoc-oe-dbx-type-p): Use mm-string-to-multibyte.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
713 (looking-at (mm-string-to-multibyte "\317\255\022\376"))) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
714 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
715 (defun nndoc-read-little-endian () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
716 (+ (prog1 (char-after) (forward-char 1)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
717 (lsh (prog1 (char-after) (forward-char 1)) 8) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
718 (lsh (prog1 (char-after) (forward-char 1)) 16) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
719 (lsh (prog1 (char-after) (forward-char 1)) 24))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
720 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
721 (defun nndoc-oe-dbx-decode-block () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
722 (list |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
723 (nndoc-read-little-endian) ;; this address |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
724 (nndoc-read-little-endian) ;; next address offset |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
725 (nndoc-read-little-endian) ;; blocksize |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
726 (nndoc-read-little-endian))) ;; next address |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
727 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
728 (defun nndoc-oe-dbx-dissection () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
729 (let ((i 0) blk p tp) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
730 (goto-char 60117) ;; 0x0000EAD4+1 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
731 (setq p (point)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
732 (unless (eobp) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
733 (setq blk (nndoc-oe-dbx-decode-block))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
734 (while (and blk (> (car blk) 0) (or (zerop (nth 3 blk)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
735 (> (nth 3 blk) p))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
736 (push (list (incf i) p nil nil nil 0) nndoc-dissection-alist) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
737 (while (and (> (car blk) 0) (> (nth 3 blk) p)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
738 (goto-char (1+ (nth 3 blk))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
739 (setq blk (nndoc-oe-dbx-decode-block))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
740 (if (or (<= (car blk) p) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
741 (<= (nth 1 blk) 0) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
742 (not (zerop (nth 3 blk)))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
743 (setq blk nil) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
744 (setq tp (+ (car blk) (nth 1 blk) 17)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
745 (if (or (<= tp p) (>= tp (point-max))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
746 (setq blk nil) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
747 (goto-char tp) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
748 (setq p tp |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
749 blk (nndoc-oe-dbx-decode-block))))))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
750 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
751 (defun nndoc-oe-dbx-generate-article (article &optional head) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
752 (let ((entry (cdr (assq article nndoc-dissection-alist))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
753 (cur (current-buffer)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
754 (begin (point)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
755 blk p) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
756 (with-current-buffer nndoc-current-buffer |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
757 (setq p (car entry)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
758 (while (> p (point-min)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
759 (goto-char p) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
760 (setq blk (nndoc-oe-dbx-decode-block)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
761 (setq p (point)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
762 (with-current-buffer cur |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
763 (insert-buffer-substring nndoc-current-buffer p (+ p (nth 2 blk)))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
764 (setq p (1+ (nth 3 blk))))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
765 (goto-char begin) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
766 (while (re-search-forward "\r$" nil t) |
108765
d835100c3e8b
Replace Lisp calls to delete-backward-char by delete-char.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
106815
diff
changeset
|
767 (delete-char -1)) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
768 (when head |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
769 (goto-char begin) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
770 (when (search-forward "\n\n" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
771 (setcar (cddddr entry) (count-lines (point) (point-max))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
772 (delete-region (1- (point)) (point-max)))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
773 t)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
774 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
775 (defun nndoc-oe-dbx-generate-head (article) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
776 (nndoc-oe-dbx-generate-article article 'head)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
777 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
778 (defun nndoc-mail-in-mail-type-p () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
779 (let (found) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
780 (save-excursion |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
781 (catch 'done |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
782 (while (re-search-forward "\n\n[-A-Za-z0-9]+:" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
783 (setq found 0) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
784 (forward-line) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
785 (while (looking-at "[ \t]\\|[-A-Za-z0-9]+:") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
786 (if (looking-at "[-A-Za-z0-9]+:") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
787 (setq found (1+ found))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
788 (forward-line)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
789 (if (and (> found 0) (looking-at "\n")) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
790 (throw 'done 9999))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
791 nil)))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
792 |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
793 (defun nndoc-mail-in-mail-article-begin () |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
794 (let (point found) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
795 (if (catch 'done |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
796 (while (re-search-forward "\n\n\\([-A-Za-z0-9]+:\\)" nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
797 (setq found 0) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
798 (setq point (match-beginning 1)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
799 (forward-line) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
800 (while (looking-at "[ \t]\\|[-A-Za-z0-9]+:") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
801 (if (looking-at "[-A-Za-z0-9]+:") |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
802 (setq found (1+ found))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
803 (forward-line)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
804 (if (and (> found 0) (looking-at "\n")) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
805 (throw 'done t))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
806 nil) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
807 (goto-char point)))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
808 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
809 (deffoo nndoc-request-accept-article (group &optional server last) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
810 nil) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
811 |
17493 | 812 ;;; |
813 ;;; Functions for dissecting the documents | |
814 ;;; | |
815 | |
816 (defun nndoc-search (regexp) | |
817 (prog1 | |
818 (re-search-forward regexp nil t) | |
819 (beginning-of-line))) | |
820 | |
821 (defun nndoc-dissect-buffer () | |
822 "Go through the document and partition it into heads/bodies/articles." | |
823 (let ((i 0) | |
824 (first t) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
825 art-begin head-begin head-end body-begin body-end) |
17493 | 826 (setq nndoc-dissection-alist nil) |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110111
diff
changeset
|
827 (with-current-buffer nndoc-current-buffer |
17493 | 828 (goto-char (point-min)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
829 ;; Remove blank lines. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
830 (while (eq (following-char) ?\n) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
831 (delete-char 1)) |
110108
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
832 (when nndoc-pre-dissection-function |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
833 (save-excursion |
5412f2e311ef
gnus-html.el (gnus-html-rescale-image): The rescaling logic scaled down too much; nndoc.el (nndoc-type-alist): Added a new type for Google digests.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
834 (funcall nndoc-pre-dissection-function))) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
835 (if nndoc-dissection-function |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
836 (funcall nndoc-dissection-function) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
837 ;; Find the beginning of the file. |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
838 (when nndoc-file-begin |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
839 (nndoc-search nndoc-file-begin)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
840 ;; Go through the file. |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
841 (while (if (and first nndoc-first-article) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
842 (nndoc-search nndoc-first-article) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
843 (if art-begin |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
844 (goto-char art-begin) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
845 (nndoc-article-begin))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
846 (setq first nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
847 art-begin nil) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
848 (cond (nndoc-head-begin-function |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
849 (funcall nndoc-head-begin-function)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
850 (nndoc-head-begin |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
851 (nndoc-search nndoc-head-begin))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
852 (if (or (eobp) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
853 (and nndoc-file-end |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
854 (looking-at nndoc-file-end))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
855 (goto-char (point-max)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
856 (setq head-begin (point)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
857 (nndoc-search (or nndoc-head-end "^$")) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
858 (setq head-end (point)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
859 (if nndoc-body-begin-function |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
860 (funcall nndoc-body-begin-function) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
861 (nndoc-search (or nndoc-body-begin "^\n"))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
862 (setq body-begin (point)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
863 (or (and nndoc-body-end-function |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
864 (funcall nndoc-body-end-function)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
865 (and nndoc-body-end |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
866 (nndoc-search nndoc-body-end)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
867 (and (nndoc-article-begin) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
868 (setq art-begin (point))) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
869 (progn |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
870 (goto-char (point-max)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
871 (when nndoc-file-end |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
872 (and (re-search-backward nndoc-file-end nil t) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
873 (beginning-of-line))))) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
874 (setq body-end (point)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
875 (push (list (incf i) head-begin head-end body-begin body-end |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
876 (count-lines body-begin body-end)) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
877 nndoc-dissection-alist))))))) |
17493 | 878 |
879 (defun nndoc-article-begin () | |
880 (if nndoc-article-begin-function | |
881 (funcall nndoc-article-begin-function) | |
882 (ignore-errors | |
883 (nndoc-search nndoc-article-begin)))) | |
884 | |
885 (defun nndoc-unquote-dashes () | |
886 "Unquote quoted non-separators in digests." | |
887 (while (re-search-forward "^- -"nil t) | |
888 (replace-match "-" t t))) | |
889 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
890 ;; Against compiler warnings. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
891 (defvar nndoc-mime-split-ordinal) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
892 |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
893 (defun nndoc-dissect-mime-parts () |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
894 "Go through a MIME composite article and partition it into sub-articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
895 When a MIME entity contains sub-entities, dissection produces one article for |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
896 the header of this entity, and one article per sub-entity." |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
897 (setq nndoc-dissection-alist nil |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
898 nndoc-mime-split-ordinal 0) |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110111
diff
changeset
|
899 (with-current-buffer nndoc-current-buffer |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
900 (nndoc-dissect-mime-parts-sub (point-min) (point-max) nil nil nil))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
901 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
902 (defun nndoc-dissect-mime-parts-sub (head-begin body-end article-insert |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
903 position parent) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
904 "Dissect an entity, within a composite MIME message. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
905 The complete message or MIME entity extends from HEAD-BEGIN to BODY-END. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
906 ARTICLE-INSERT should be added at beginning for generating a full article. |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
907 The string POSITION holds a dotted decimal representation of the article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
908 position in the hierarchical structure, it is nil for the outer entity. |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
909 PARENT is the message-ID of the parent summary line, or nil for none." |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
910 (let ((case-fold-search t) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
911 (message-id (nnmail-message-id)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
912 head-end body-begin summary-insert message-rfc822 multipart-any |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
913 subject content-type type subtype boundary-regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
914 ;; Gracefully handle a missing body. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
915 (goto-char head-begin) |
33325
0ca2ddcb4da5
2000-09-29 09:56:34 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
916 (if (or (and (eq (char-after) ?\n) (or (forward-char 1) t)) |
0ca2ddcb4da5
2000-09-29 09:56:34 ShengHuo ZHU <zsh@cs.rochester.edu>
Dave Love <fx@gnu.org>
parents:
31716
diff
changeset
|
917 (search-forward "\n\n" body-end t)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
918 (setq head-end (1- (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
919 body-begin (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
920 (setq head-end body-end |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
921 body-begin body-end)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
922 (narrow-to-region head-begin head-end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
923 ;; Save MIME attributes. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
924 (goto-char head-begin) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
925 (setq content-type (message-fetch-field "Content-Type")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
926 (when content-type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
927 (when (string-match |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
928 "^ *\\([^ \t\n/;]+\\)/\\([^ \t\n/;]+\\)" content-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
929 (setq type (downcase (match-string 1 content-type)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
930 subtype (downcase (match-string 2 content-type)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
931 message-rfc822 (and (string= type "message") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
932 (string= subtype "rfc822")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
933 multipart-any (string= type "multipart"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
934 (when (string-match ";[ \t\n]*name=\\([^ \t\n;]+\\)" content-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
935 (setq subject (match-string 1 content-type))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
936 (when (string-match "boundary=\"?\\([^\"\n]*[^\" \t\n]\\)" content-type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
937 (setq boundary-regexp (concat "^--" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
938 (regexp-quote |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
939 (match-string 1 content-type)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
940 "\\(--\\)?[ \t]*\n")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
941 (unless subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
942 (when (or multipart-any (not article-insert)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
943 (setq subject (message-fetch-field "Subject")))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
944 (unless type |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
945 (setq type "text" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
946 subtype "plain")) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
947 ;; Prepare the article and summary inserts. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
948 (unless article-insert |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
949 (setq article-insert (buffer-string) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
950 head-end head-begin)) |
45957
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
951 ;; Fix MIME-Version |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
952 (unless (string-match "MIME-Version:" article-insert) |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
953 (setq article-insert |
4afe5a9ced92
* nndoc.el (nndoc-mime-digest-type-p): Set proper file-end.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
33325
diff
changeset
|
954 (concat article-insert "MIME-Version: 1.0\n"))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
955 (setq summary-insert article-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
956 ;; - summary Subject. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
957 (setq summary-insert |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
958 (let ((line (concat "Subject: <" position |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
959 (and position multipart-any ".") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
960 (and multipart-any "*") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
961 (and (or position multipart-any) " ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
962 (cond ((string= subtype "plain") type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
963 ((string= subtype "basic") type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
964 (t subtype)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
965 ">" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
966 (and subject " ") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
967 subject |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
968 "\n"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
969 (if (string-match "Subject:.*\n\\([ \t].*\n\\)*" summary-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
970 (replace-match line t t summary-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
971 (concat summary-insert line)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
972 ;; - summary Message-ID. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
973 (setq summary-insert |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
974 (let ((line (concat "Message-ID: " message-id "\n"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
975 (if (string-match "Message-ID:.*\n\\([ \t].*\n\\)*" summary-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
976 (replace-match line t t summary-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
977 (concat summary-insert line)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
978 ;; - summary References. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
979 (when parent |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
980 (setq summary-insert |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
981 (let ((line (concat "References: " parent "\n"))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
982 (if (string-match "References:.*\n\\([ \t].*\n\\)*" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
983 summary-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
984 (replace-match line t t summary-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
985 (concat summary-insert line))))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
986 ;; Generate dissection information for this entity. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
987 (push (list (incf nndoc-mime-split-ordinal) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
988 head-begin head-end body-begin body-end |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
989 (count-lines body-begin body-end) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
990 article-insert summary-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
991 nndoc-dissection-alist) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
992 ;; Recurse for all sub-entities, if any. |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
993 (widen) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
994 (cond |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
995 (message-rfc822 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
996 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
997 (nndoc-dissect-mime-parts-sub body-begin body-end nil |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
998 position message-id))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
999 ((and multipart-any boundary-regexp) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1000 (let ((part-counter 0) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1001 part-begin part-end eof-flag) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1002 (while (string-match "\ |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1003 ^\\(Lines\\|Content-\\(Type\\|Transfer-Encoding\\|Disposition\\)\\):.*\n\\([ \t].*\n\\)*" |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1004 article-insert) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1005 (setq article-insert (replace-match "" t t article-insert))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1006 (let ((case-fold-search nil)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1007 (goto-char body-begin) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1008 (setq eof-flag (not (re-search-forward boundary-regexp body-end t))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1009 (while (not eof-flag) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1010 (setq part-begin (point)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1011 (cond ((re-search-forward boundary-regexp body-end t) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1012 (or (not (match-string 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1013 (string= (match-string 1) "") |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1014 (setq eof-flag t)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1015 (forward-line -1) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1016 (setq part-end (point)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1017 (forward-line 1)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1018 (t (setq part-end body-end |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1019 eof-flag t))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1020 (save-excursion |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1021 (nndoc-dissect-mime-parts-sub |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1022 part-begin part-end article-insert |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1023 (concat position |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1024 (and position ".") |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1025 (format "%d" (incf part-counter))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
1026 message-id))))))))) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1027 |
17493 | 1028 ;;;###autoload |
1029 (defun nndoc-add-type (definition &optional position) | |
1030 "Add document DEFINITION to the list of nndoc document definitions. | |
1031 If POSITION is nil or `last', the definition will be added | |
1032 as the last checked definition, if t or `first', add as the | |
1033 first definition, and if any other symbol, add after that | |
1034 symbol in the alist." | |
1035 ;; First remove any old instances. | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
1036 (gnus-pull (car definition) nndoc-type-alist) |
17493 | 1037 ;; Then enter the new definition in the proper place. |
1038 (cond | |
1039 ((or (null position) (eq position 'last)) | |
1040 (setq nndoc-type-alist (nconc nndoc-type-alist (list definition)))) | |
1041 ((or (eq position t) (eq position 'first)) | |
1042 (push definition nndoc-type-alist)) | |
1043 (t | |
1044 (let ((list (memq (assq position nndoc-type-alist) | |
1045 nndoc-type-alist))) | |
1046 (unless list | |
1047 (error "No such position: %s" position)) | |
1048 (setcdr list (cons definition (cdr list))))))) | |
1049 | |
1050 (provide 'nndoc) | |
1051 | |
1052 ;;; nndoc.el ends here |