Quassia Gnus v0.25.
[elisp/gnus.git-] / lisp / nndoc.el
index 0ecd3ca..1727d18 100644 (file)
@@ -43,6 +43,11 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
 (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")
@@ -86,8 +91,8 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
      (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
@@ -279,7 +284,8 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
        (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))