From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/7479 Path: main.gmane.org!not-for-mail From: Sudish Joseph Newsgroups: gmane.emacs.gnus.general Subject: Re: [ patch ] async stuff fix(?) (was Re: 0.3 and async pre-fetch) Date: 04 Aug 1996 20:39:17 -0400 Sender: sj@mindspring.com Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.69) Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035147785 7350 80.91.224.250 (20 Oct 2002 21:03:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:03:05 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.5/8.6.9) with SMTP id BAA25485 for ; Mon, 5 Aug 1996 01:03:11 -0700 Original-Received: from atreides.erehwon.org (sj@user-168-121-167-78.dialup.mindspring.com [168.121.167.78]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Mon, 5 Aug 1996 02:34:53 +0200 Original-Received: (from sj@localhost) by atreides.erehwon.org (8.7.5/8.7.3) id UAA00694; Sun, 4 Aug 1996 20:39:18 -0400 Original-To: ding@ifi.uio.no In-Reply-To: Sudish Joseph's message of 04 Aug 1996 18:09:51 -0400 Original-Lines: 64 X-Mailer: Red Gnus v0.5/XEmacs 19.14 Xref: main.gmane.org gmane.emacs.gnus.general:7479 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:7479 More fixes. These need to be applied over the last patch. The first one is for a weird condition that I'm not sure of the cause of. The only explanation I can come up with is that the filter is being called by XEmacs while the last filter is still active. I couldn't find anything in Lispref about this. Anyone know how to protect a few calls against this? We don't need to stop it altogether, the critical section is very small in the filter. The first patch below should make this safe -- unless the reentrant call occurs before the 'insert is executed. Making it safe in the face of that takes some more thinking (don't define a filter and use an after-change hook like Lars suggested? or keep a variable that tracks how many instances of the filter are active and accumulate the o/p from the second and later calls in a string which is handled by the first instance of the filter before it exits?) The second one half-handles the case in the callback when it's arg is nil (indicating that the buffer doesn't contain a valid article). I'm not sure of what to do here. Note that the checking for error codes in the filter isn't very robust in the face of filter race conditions either. -Sudish Sun Aug 4 20:33:36 1996 Sudish Joseph * gnus-async.el (gnus-async-prefetch-article): Check ARG before assuming that the buffer contains an article. * nntp.el (nntp-process-filter): Insert all o/p at eob. --- nntp.el~ Sun Aug 4 20:25:41 1996 +++ nntp.el Sun Aug 4 20:25:41 1996 @@ -494,9 +494,9 @@ (let (point eoresponse b e) (set-buffer (process-buffer proc)) ;; Insert string, moving the process-marker. - (setq point (goto-char (process-mark proc))) + (setq point (goto-char (set-marker (process-mark proc) (point-max)))) (insert string) - (set-marker (process-mark proc) (point)) + (set-marker (process-mark proc) (point-max)) (if (and (= point (point-min)) (string-match "^45" string)) (progn --- gnus-async.el~ Sun Aug 4 20:35:40 1996 +++ gnus-async.el Sun Aug 4 20:35:40 1996 @@ -101,9 +101,10 @@ (save-excursion (nnheader-set-temp-buffer gnus-async-prefetch-article-buffer t) - (push (list ',(intern (format "%s-%d" group article)) - begin-marker end-marker ,group ,article) - gnus-async-article-alist) + (when (and arg begin-marker end-marker) + (push (list ',(intern (format "%s-%d" group article)) + begin-marker end-marker ,group ,article) + gnus-async-article-alist)) (when (gnus-buffer-live-p ,summary) ,(when next `(gnus-async-prefetch-article