From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/16199 Path: main.gmane.org!not-for-mail From: Mike McEwan Newsgroups: gmane.emacs.gnus.general Subject: [patch] `gnus-agent-braid-nov' Date: 23 Aug 1998 03:28:58 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035155106 26358 80.91.224.250 (20 Oct 2002 23:05:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:05:06 +0000 (UTC) Return-Path: Original-Received: from gwyn.tux.org (gwyn.tux.org [207.96.122.8]) by altair.xemacs.org (8.9.1/8.9.1) with ESMTP id VAA11174 for ; Sat, 22 Aug 1998 21:30:20 -0700 Original-Received: from sina.hpc.uh.edu (Sina.HPC.UH.EDU [129.7.3.5]) by gwyn.tux.org (8.8.8/8.8.8) with ESMTP id AAA18517 for ; Sun, 23 Aug 1998 00:31:45 -0400 Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id XAK25438; Sat, 22 Aug 1998 23:28:25 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 22 Aug 1998 23:24:34 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [209.195.19.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id XAA25425 for ; Sat, 22 Aug 1998 23:24:25 -0500 (CDT) Original-Received: from post.mail.demon.net (post-20.mail.demon.net [194.217.242.27]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id AAA17926 for ; Sun, 23 Aug 1998 00:24:11 -0400 (EDT) Original-Received: from [158.152.62.156] (helo=lotusland.demon.co.uk) by post.mail.demon.net with smtp (Exim 2.02 #1) id 0zARhH-0001nv-00 for ding@gnus.org; Sun, 23 Aug 1998 04:24:07 +0000 Original-Received: from mike by lotusland.demon.co.uk with local (Exim 2.02 #1) id 0zARhG-00015e-00 for ding@gnus.org; Sun, 23 Aug 1998 05:24:06 +0100 Original-To: ding@gnus.org X-Mailer: Gnus v5.6.39/XEmacs 20.4 - "Emerald" Original-Lines: 119 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:16199 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:16199 Following my previous patch to `gnus-agent-braid-nov', `gnus-agent-copy-nov-line' is now being called more regularly. However, this has been resulting in "Invalid read syntax" messages. I think this happens when an article has been cancelled and hence does not exist in ` *Gnus agent overview*', but I'm not sure. I don't really know why `gnus-agent-copy-nov-line' is being called in the first place. Anyway, the following patch takes care of this situation. Whilst I'm here. Lars, are you going to remove the: "This manual corresponds to Gnus 5.6.33." from the texi file? I keep thinking I've messed up my upgrades :-). -- Mike. --- ChangeLog~ Sat Aug 22 09:30:37 1998 +++ ChangeLog Sun Aug 23 03:32:39 1998 @@ -1,3 +1,9 @@ +1998-08-23 Mike McEwan + + * gnus-agent.el (gnus-agent-copy-nov-line): Return to beginning of + line before next read. + (gnus-agent-braid-nov): Remove redundant `let'. + Sat Aug 22 10:28:25 1998 Lars Magne Ingebrigtsen * gnus.el: Gnus v5.6.39 is released. --- gnus-agent.el.orig Sun Aug 23 03:19:27 1998 +++ gnus-agent.el Sun Aug 23 03:21:05 1998 @@ -790,47 +790,48 @@ (setq b (point)) (if (eq article (read (current-buffer))) (setq e (progn (forward-line 1) (point))) - (setq e b)) + (progn + (beginning-of-line) + (setq e b))) (set-buffer nntp-server-buffer) (insert-buffer-substring gnus-agent-overview-buffer b e))) (defun gnus-agent-braid-nov (group articles file) - (let (beg end) - (set-buffer gnus-agent-overview-buffer) - (goto-char (point-min)) - (set-buffer nntp-server-buffer) - (erase-buffer) - (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)))) - (when articles - (let (b e) - (set-buffer gnus-agent-overview-buffer) - (setq b (point) - e (point-max)) - (set-buffer nntp-server-buffer) - (insert-buffer-substring gnus-agent-overview-buffer b e)))))) + (set-buffer gnus-agent-overview-buffer) + (goto-char (point-min)) + (set-buffer nntp-server-buffer) + (erase-buffer) + (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)))) + (when articles + (let (b e) + (set-buffer gnus-agent-overview-buffer) + (setq b (point) + e (point-max)) + (set-buffer nntp-server-buffer) + (insert-buffer-substring gnus-agent-overview-buffer b e))))) (defun gnus-agent-load-alist (group &optional dir) "Load the article-state alist for GROUP."