changeset 15981:b131fbcf8530

1996-08-29 Lars Magne Ingebrigtsen <larsi@ifi.uio.no> * nndoc.el (nndoc-mbox-article-begin): New function. (nndoc-type-alist): Enter it into definition. (nndoc-dissect-buffer): Use new definition.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Fri, 30 Aug 1996 01:50:25 +0000
parents b3fc648a4a8e
children 6654a42f95e9
files lisp/nndoc.el
diffstat 1 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/nndoc.el	Fri Aug 30 00:27:46 1996 +0000
+++ b/lisp/nndoc.el	Fri Aug 30 01:50:25 1996 +0000
@@ -53,11 +53,8 @@
      (article-begin . "^#! *rnews +\\([0-9]+\\) *\n")
      (body-end-function . nndoc-rnews-body-end))
     (mbox 
-     (article-begin . 
-		    ,(let ((delim (concat "^" message-unix-mail-delimiter)))
-		       (if (string-match "\n\\'" delim)
-			   (substring delim 0 (match-beginning 0))
-			 delim)))
+     (article-begin . "^From \\([^ \n]*\\(\\|\".*\"[^ \n]*\\)\\)  ?\\([^ \n]*\\) *\\([^ ]*\\) *\\([0-9]*\\) *\\([0-9:]*\\) *\\([A-Z]?[A-Z]?[A-Z][A-Z]\\( DST\\)?\\|[-+]?[0-9][0-9][0-9][0-9]\\|\\) * [0-9][0-9]\\([0-9]*\\) *\\([A-Z]?[A-Z]?[A-Z][A-Z]\\( DST\\)?\\|[-+]?[0-9][0-9][0-9][0-9]\\|\\) *\\(remote from .*\\)?\n")
+     (article-begin-function . nndoc-mbox-article-begin)
      (body-end-function . nndoc-mbox-body-end))
     (babyl 
      (article-begin . "\^_\^L *\n")
@@ -107,6 +104,7 @@
 (defvoo nndoc-first-article nil)
 (defvoo nndoc-article-end nil)
 (defvoo nndoc-article-begin nil)
+(defvoo nndoc-article-begin-function nil)
 (defvoo nndoc-head-begin nil)
 (defvoo nndoc-head-end nil)
 (defvoo nndoc-file-end nil)
@@ -338,7 +336,7 @@
 		nndoc-body-begin nndoc-body-end-function nndoc-body-end
 		nndoc-prepare-body nndoc-article-transform
 		nndoc-generate-head nndoc-body-begin-function
-		nndoc-head-begin-function)))
+		nndoc-head-begin-function nndoc-article-begin-function)))
     (while vars
       (set (pop vars) nil)))
   (let* (defs guess)
@@ -371,7 +369,9 @@
       ;; Go through the file.
       (while (if (and first nndoc-first-article)
 		 (nndoc-search nndoc-first-article)
-	       (nndoc-search nndoc-article-begin))
+	       (if nndoc-article-begin-function
+		   (funcall nndoc-article-begin-function)
+		 (nndoc-search nndoc-article-begin)))
 	(setq first nil)
 	(cond (nndoc-head-begin-function
 	       (funcall nndoc-head-begin-function))
@@ -391,7 +391,9 @@
 		   (funcall nndoc-body-end-function))
 	      (and nndoc-body-end
 		   (nndoc-search nndoc-body-end))
-	      (nndoc-search nndoc-article-begin)
+	      (if nndoc-article-begin-function
+		  (funcall nndoc-article-begin-function)
+		(nndoc-search nndoc-article-begin))
 	      (progn
 		(goto-char (point-max))
 		(when nndoc-file-end
@@ -411,6 +413,10 @@
   (and (re-search-forward nndoc-article-begin nil t)
        (goto-char (match-beginning 0))))
 
+(defun nndoc-mbox-article-begin ()
+  (when (re-search-forward nndoc-article-begin nil t)
+    (goto-char (match-beginning 0))))
+
 (defun nndoc-mbox-body-end ()
   (let ((beg (point))
 	len end)