;;; nndoc.el --- single file access for Gnus
-;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc.
-;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Keywords: news
(require 'message)
(require 'nnmail)
(require 'nnoo)
+(require 'gnus-util)
(eval-when-compile (require 'cl))
(nnoo-declare nndoc)
(defvoo nndoc-post-type 'mail
"*Whether the nndoc group is `mail' or `post'.")
+(defvoo nndoc-open-document-hook 'nnheader-ms-strip-cr
+ "Hook run after opening a document.
+The default function removes all trailing carriage returns
+from the document.")
+
(defvar nndoc-type-alist
`((mmdf
(article-begin . "^\^A\^A\^A\^A\n")
(file-end . "")
(subtype digest guess))
(standard-digest
- (first-article . ,(concat "^" (make-string 70 ?-) "\n\n+"))
- (article-begin . ,(concat "^\n" (make-string 30 ?-) "\n\n+"))
+ (first-article . ,(concat "^" (make-string 70 ?-) "\n *\n+"))
+ (article-begin . ,(concat "^\n" (make-string 30 ?-) "\n *\n+"))
(prepare-body-function . nndoc-unquote-dashes)
(body-end-function . nndoc-digest-body-end)
- (head-end . "^ ?$")
- (body-begin . "^ ?\n")
+ (head-end . "^ *$")
+ (body-begin . "^ *\n")
(file-end . "^End of .*digest.*[0-9].*\n\\*\\*\\|^End of.*Digest *$")
(subtype digest guess))
(slack-digest
(erase-buffer)
(if (stringp nndoc-address)
(nnheader-insert-file-contents nndoc-address)
- (insert-buffer-substring nndoc-address)))))
+ (insert-buffer-substring nndoc-address))
+ (run-hooks 'nndoc-open-document-hook))))
;; Initialize the nndoc structures according to this new document.
(when (and nndoc-current-buffer
(not nndoc-dissection-alist))
(defun nndoc-babyl-body-begin ()
(re-search-forward "^\n" nil t)
- (when (looking-at "\*\*\* EOOH \*\*\*")
+ (when (looking-at "\\*\\*\\* EOOH \\*\\*\\*")
(let ((next (or (save-excursion
(re-search-forward nndoc-article-begin nil t))
(point-max))))
(defun nndoc-babyl-head-begin ()
(when (re-search-forward "^[0-9].*\n" nil t)
- (when (looking-at "\*\*\* EOOH \*\*\*")
+ (when (looking-at "\\*\\*\\* EOOH \\*\\*\\*")
(forward-line 1))
t))
(insert "From: " (or from "unknown")
"\nSubject: " (or subject "(no subject)") "\n")))
+(deffoo nndoc-request-accept-article (group &optional server last)
+ nil)
+
;;;
first definition, and if any other symbol, add after that
symbol in the alist."
;; First remove any old instances.
- (setq nndoc-type-alist
- (delq (assq (car definition) nndoc-type-alist)
- nndoc-type-alist))
+ (gnus-pull (car definition) nndoc-type-alist)
;; Then enter the new definition in the proper place.
(cond
((or (null position) (eq position 'last))