- (if (search-forward (nnbabyl-article-string article) nil t)
- (let (start stop summary-line)
- (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
- (while (and (not (looking-at ".+:"))
- (zerop (forward-line 1))))
- (setq start (point))
- (or (and (re-search-forward
- (concat "^" nnbabyl-mail-delimiter) nil t)
- (forward-line -1))
- (goto-char (point-max)))
- (setq stop (point))
- (let ((nntp-server-buffer (or buffer nntp-server-buffer)))
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (insert-buffer-substring nnbabyl-mbox-buffer start stop)
- (goto-char (point-min))
- ;; If there is an EOOH header, then we have to remove some
- ;; duplicated headers.
- (setq summary-line (looking-at "Summary-line:"))
- (when (search-forward "\n*** EOOH ***" nil t)
- (if summary-line
- ;; The headers to be deleted are located before the
- ;; EOOH line...
- (delete-region (point-min) (progn (forward-line 1)
- (point)))
- ;; ...or after.
- (delete-region (progn (beginning-of-line) (point))
- (or (search-forward "\n\n" nil t)
- (point)))))
- (if (numberp article)
- (cons nnbabyl-current-group article)
- (nnbabyl-article-group-number)))))))
-
-(defun nnbabyl-request-group (group &optional server dont-check)
+ (when (search-forward (nnbabyl-article-string article) nil t)
+ (let (start stop summary-line)
+ (unless (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
+ (goto-char (point-min))
+ (end-of-line))
+ (while (and (not (looking-at ".+:"))
+ (zerop (forward-line 1))))
+ (setq start (point))
+ (or (when (re-search-forward
+ (concat "^" nnbabyl-mail-delimiter) nil t)
+ (beginning-of-line)
+ t)
+ (goto-char (point-max)))
+ (setq stop (point))
+ (let ((nntp-server-buffer (or buffer nntp-server-buffer)))
+ (set-buffer nntp-server-buffer)
+ (erase-buffer)
+ (insert-buffer-substring nnbabyl-mbox-buffer start stop)
+ (goto-char (point-min))
+ ;; If there is an EOOH header, then we have to remove some
+ ;; duplicated headers.
+ (setq summary-line (looking-at "Summary-line:"))
+ (when (search-forward "\n*** EOOH ***" nil t)
+ (if summary-line
+ ;; The headers to be deleted are located before the
+ ;; EOOH line...
+ (delete-region (point-min) (progn (forward-line 1)
+ (point)))
+ ;; ...or after.
+ (delete-region (progn (beginning-of-line) (point))
+ (or (search-forward "\n\n" nil t)
+ (point)))))
+ (if (numberp article)
+ (cons nnbabyl-current-group article)
+ (nnbabyl-article-group-number)))))))
+
+(deffoo nnbabyl-request-group (group &optional server dont-check info)