1 |
;;; nndoc.el --- single file access for Gnus |
;;; nndoc.el --- single file access for Gnus |
2 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 |
3 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
58 |
`((mmdf |
`((mmdf |
59 |
(article-begin . "^\^A\^A\^A\^A\n") |
(article-begin . "^\^A\^A\^A\^A\n") |
60 |
(body-end . "^\^A\^A\^A\^A\n")) |
(body-end . "^\^A\^A\^A\^A\n")) |
61 |
(exim-bounce |
(mime-digest |
62 |
(article-begin . "^------ This is a copy of the message, including all the headers. ------\n\n") |
(article-begin . "") |
63 |
(body-end-function . nndoc-exim-bounce-body-end-function)) |
(head-begin . "^ ?\n") |
64 |
|
(head-end . "^ ?$") |
65 |
|
(body-end . "") |
66 |
|
(file-end . "") |
67 |
|
(subtype digest guess)) |
68 |
|
(mime-parts |
69 |
|
(generate-head-function . nndoc-generate-mime-parts-head) |
70 |
|
(article-transform-function . nndoc-transform-mime-parts)) |
71 |
(nsmail |
(nsmail |
72 |
(article-begin . "^From - ")) |
(article-begin . "^From - ")) |
73 |
(news |
(news |
83 |
(body-end . "\^_") |
(body-end . "\^_") |
84 |
(body-begin-function . nndoc-babyl-body-begin) |
(body-begin-function . nndoc-babyl-body-begin) |
85 |
(head-begin-function . nndoc-babyl-head-begin)) |
(head-begin-function . nndoc-babyl-head-begin)) |
86 |
|
(exim-bounce |
87 |
|
(article-begin . "^------ This is a copy of the message, including all the headers. ------\n\n") |
88 |
|
(body-end-function . nndoc-exim-bounce-body-end-function)) |
89 |
(rfc934 |
(rfc934 |
90 |
(article-begin . "^--.*\n+") |
(article-begin . "^--.*\n+") |
91 |
(body-end . "^--.*$") |
(body-end . "^--.*$") |
101 |
(head-end . "^\t") |
(head-end . "^\t") |
102 |
(generate-head-function . nndoc-generate-clari-briefs-head) |
(generate-head-function . nndoc-generate-clari-briefs-head) |
103 |
(article-transform-function . nndoc-transform-clari-briefs)) |
(article-transform-function . nndoc-transform-clari-briefs)) |
104 |
(mime-digest |
|
|
(article-begin . "") |
|
|
(head-begin . "^ ?\n") |
|
|
(head-end . "^ ?$") |
|
|
(body-end . "") |
|
|
(file-end . "") |
|
|
(subtype digest guess)) |
|
|
(mime-parts |
|
|
(generate-head-function . nndoc-generate-mime-parts-head) |
|
|
(article-transform-function . nndoc-transform-mime-parts)) |
|
105 |
(standard-digest |
(standard-digest |
106 |
(first-article . ,(concat "^" (make-string 70 ?-) "\n *\n+")) |
(first-article . ,(concat "^" (make-string 70 ?-) "\n *\n+")) |
107 |
(article-begin . ,(concat "^\n" (make-string 30 ?-) "\n *\n+")) |
(article-begin . ,(concat "^\n" (make-string 30 ?-) "\n *\n+")) |
394 |
(error "Document is not of any recognized type")) |
(error "Document is not of any recognized type")) |
395 |
(if result |
(if result |
396 |
(car entry) |
(car entry) |
397 |
(cadar (sort results 'car-less-than-car))))) |
(cadar (last (sort results 'car-less-than-car)))))) |
398 |
|
|
399 |
;;; |
;;; |
400 |
;;; Built-in type predicates and functions |
;;; Built-in type predicates and functions |
772 |
"Go through the document and partition it into heads/bodies/articles." |
"Go through the document and partition it into heads/bodies/articles." |
773 |
(let ((i 0) |
(let ((i 0) |
774 |
(first t) |
(first t) |
775 |
head-begin head-end body-begin body-end) |
art-begin head-begin head-end body-begin body-end) |
776 |
(setq nndoc-dissection-alist nil) |
(setq nndoc-dissection-alist nil) |
777 |
(save-excursion |
(save-excursion |
778 |
(set-buffer nndoc-current-buffer) |
(set-buffer nndoc-current-buffer) |
788 |
;; Go through the file. |
;; Go through the file. |
789 |
(while (if (and first nndoc-first-article) |
(while (if (and first nndoc-first-article) |
790 |
(nndoc-search nndoc-first-article) |
(nndoc-search nndoc-first-article) |
791 |
(nndoc-article-begin)) |
(if art-begin |
792 |
(setq first nil) |
(goto-char art-begin) |
793 |
|
(nndoc-article-begin))) |
794 |
|
(setq first nil |
795 |
|
art-begin nil) |
796 |
(cond (nndoc-head-begin-function |
(cond (nndoc-head-begin-function |
797 |
(funcall nndoc-head-begin-function)) |
(funcall nndoc-head-begin-function)) |
798 |
(nndoc-head-begin |
(nndoc-head-begin |
812 |
(funcall nndoc-body-end-function)) |
(funcall nndoc-body-end-function)) |
813 |
(and nndoc-body-end |
(and nndoc-body-end |
814 |
(nndoc-search nndoc-body-end)) |
(nndoc-search nndoc-body-end)) |
815 |
(nndoc-article-begin) |
(and (nndoc-article-begin) |
816 |
|
(setq art-begin (point))) |
817 |
(progn |
(progn |
818 |
(goto-char (point-max)) |
(goto-char (point-max)) |
819 |
(when nndoc-file-end |
(when nndoc-file-end |
895 |
subtype "plain")) |
subtype "plain")) |
896 |
;; Prepare the article and summary inserts. |
;; Prepare the article and summary inserts. |
897 |
(unless article-insert |
(unless article-insert |
898 |
(setq article-insert (buffer-substring (point-min) (point-max)) |
(setq article-insert (buffer-string) |
899 |
head-end head-begin)) |
head-end head-begin)) |
900 |
;; Fix MIME-Version |
;; Fix MIME-Version |
901 |
(unless (string-match "MIME-Version:" article-insert) |
(unless (string-match "MIME-Version:" article-insert) |