Commit e1e36689 authored by Lars Magne Ingebrigtsen's avatar Lars Magne Ingebrigtsen
Browse files

1996-08-29 Lars Magne Ingebrigtsen <>

	* nndoc.el (nndoc-mbox-article-begin): New function.
	(nndoc-type-alist): Enter it into definition.
	(nndoc-dissect-buffer): Use new definition.
parent cba446dd
...@@ -53,11 +53,8 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward', ...@@ -53,11 +53,8 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
(article-begin . "^#! *rnews +\\([0-9]+\\) *\n") (article-begin . "^#! *rnews +\\([0-9]+\\) *\n")
(body-end-function . nndoc-rnews-body-end)) (body-end-function . nndoc-rnews-body-end))
(mbox (mbox
(article-begin . (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")
,(let ((delim (concat "^" message-unix-mail-delimiter))) (article-begin-function . nndoc-mbox-article-begin)
(if (string-match "\n\\'" delim)
(substring delim 0 (match-beginning 0))
(body-end-function . nndoc-mbox-body-end)) (body-end-function . nndoc-mbox-body-end))
(babyl (babyl
(article-begin . "\^_\^L *\n") (article-begin . "\^_\^L *\n")
...@@ -107,6 +104,7 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward', ...@@ -107,6 +104,7 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
(defvoo nndoc-first-article nil) (defvoo nndoc-first-article nil)
(defvoo nndoc-article-end nil) (defvoo nndoc-article-end nil)
(defvoo nndoc-article-begin nil) (defvoo nndoc-article-begin nil)
(defvoo nndoc-article-begin-function nil)
(defvoo nndoc-head-begin nil) (defvoo nndoc-head-begin nil)
(defvoo nndoc-head-end nil) (defvoo nndoc-head-end nil)
(defvoo nndoc-file-end nil) (defvoo nndoc-file-end nil)
...@@ -338,7 +336,7 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward', ...@@ -338,7 +336,7 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
nndoc-body-begin nndoc-body-end-function nndoc-body-end nndoc-body-begin nndoc-body-end-function nndoc-body-end
nndoc-prepare-body nndoc-article-transform nndoc-prepare-body nndoc-article-transform
nndoc-generate-head nndoc-body-begin-function nndoc-generate-head nndoc-body-begin-function
nndoc-head-begin-function))) nndoc-head-begin-function nndoc-article-begin-function)))
(while vars (while vars
(set (pop vars) nil))) (set (pop vars) nil)))
(let* (defs guess) (let* (defs guess)
...@@ -371,7 +369,9 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward', ...@@ -371,7 +369,9 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
;; Go through the file. ;; Go through the file.
(while (if (and first nndoc-first-article) (while (if (and first nndoc-first-article)
(nndoc-search 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) (setq first nil)
(cond (nndoc-head-begin-function (cond (nndoc-head-begin-function
(funcall nndoc-head-begin-function)) (funcall nndoc-head-begin-function))
...@@ -391,7 +391,9 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward', ...@@ -391,7 +391,9 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
(funcall nndoc-body-end-function)) (funcall nndoc-body-end-function))
(and nndoc-body-end (and nndoc-body-end
(nndoc-search 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 (progn
(goto-char (point-max)) (goto-char (point-max))
(when nndoc-file-end (when nndoc-file-end
...@@ -411,6 +413,10 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward', ...@@ -411,6 +413,10 @@ One of `mbox', `babyl', `digest', `news', `rnews', `mmdf', `forward',
(and (re-search-forward nndoc-article-begin nil t) (and (re-search-forward nndoc-article-begin nil t)
(goto-char (match-beginning 0)))) (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 () (defun nndoc-mbox-body-end ()
(let ((beg (point)) (let ((beg (point))
len end) len end)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment