From 5bd863cc03276eab31dfa62962d3ab41743292d2 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 8 Feb 2002 06:29:47 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 5 ++++ lisp/gnus-agent.el | 67 ++++++++++++++++++++++++---------------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee9ef51..2f67ce6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-02-08 ShengHuo ZHU + + * gnus-agent.el (gnus-agent-braid-nov): Find the first article to + copy. + 2002-02-07 Paul Jarc * gnus-util.el (gnus-split-references): Allow (broken) Message-IDs diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 6b07dea..3030d36 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -1110,46 +1110,41 @@ the actual number of articles toggled is returned." (insert-buffer-substring gnus-agent-overview-buffer b e)))) (defun gnus-agent-braid-nov (group articles file) - (set-buffer gnus-agent-overview-buffer) - (goto-char (point-min)) - (set-buffer nntp-server-buffer) - (erase-buffer) - (nnheader-insert-file-contents file) - (goto-char (point-max)) - (if (or (= (point-min) (point-max)) - (progn - (forward-line -1) - (< (read (current-buffer)) (car articles)))) - ;; We have only headers that are after the older headers, - ;; so we just append them. - (progn - (goto-char (point-max)) - (insert-buffer-substring gnus-agent-overview-buffer)) - ;; We do it the hard way. - (nnheader-find-nov-line (car articles)) - (gnus-agent-copy-nov-line (car articles)) - (pop articles) - (while (and articles - (not (eobp))) - (while (and (not (eobp)) - (< (read (current-buffer)) (car articles))) - (forward-line 1)) - (beginning-of-line) - (unless (eobp) - (gnus-agent-copy-nov-line (car articles)) - (setq articles (cdr articles)))) + (let (start last) + (set-buffer gnus-agent-overview-buffer) + (goto-char (point-min)) + (set-buffer nntp-server-buffer) + (erase-buffer) + (nnheader-insert-file-contents file) + (goto-char (point-max)) + (unless (or (= (point-min) (point-max)) + (progn + (forward-line -1) + (< (setq last (read (current-buffer))) (car articles)))) + ;; We do it the hard way. + (nnheader-find-nov-line (car articles)) + (gnus-agent-copy-nov-line (pop articles)) + (while (and articles + (not (eobp))) + (while (and (not (eobp)) + (< (read (current-buffer)) (car articles))) + (forward-line 1)) + (beginning-of-line) + (unless (eobp) + (gnus-agent-copy-nov-line (pop articles))))) + ;; Copy the rest lines (set-buffer nntp-server-buffer) + (goto-char (point-max)) (when articles - (let (b e) + (when last (set-buffer gnus-agent-overview-buffer) - (setq b (point) - e (point-max)) (while (and (not (eobp)) - (<= (read (current-buffer)) (car articles))) - (forward-line 1) - (setq b (point))) - (set-buffer nntp-server-buffer) - (insert-buffer-substring gnus-agent-overview-buffer b e))))) + (<= (read (current-buffer)) last)) + (forward-line 1)) + (beginning-of-line) + (setq start (point)) + (set-buffer nntp-server-buffer)) + (insert-buffer-substring gnus-agent-overview-buffer start)))) (defun gnus-agent-load-alist (group &optional dir) "Load the article-state alist for GROUP." -- 1.7.10.4