From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50138 Path: main.gmane.org!not-for-mail From: Kevin Greiner Newsgroups: gmane.emacs.gnus.general Subject: Re: marking articles at group exit Date: Sat, 15 Feb 2003 22:56:13 -0600 Sender: owner-ding@hpc.uh.edu Message-ID: References: <4nvfzmdigq.fsf@lockgroove.bwh.harvard.edu> <4nof5eadju.fsf@lockgroove.bwh.harvard.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045371309 24332 80.91.224.249 (16 Feb 2003 04:55:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 16 Feb 2003 04:55:09 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18kGpX-0006KC-00 for ; Sun, 16 Feb 2003 05:55:07 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18kGqy-0002cc-00; Sat, 15 Feb 2003 22:56:36 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 15 Feb 2003 22:57:34 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id WAA12757 for ; Sat, 15 Feb 2003 22:57:22 -0600 (CST) Original-Received: (qmail 58116 invoked by alias); 16 Feb 2003 04:56:19 -0000 Original-Received: (qmail 58111 invoked from network); 16 Feb 2003 04:56:19 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by 66.230.238.6 with SMTP; 16 Feb 2003 04:56:19 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 18kH27-0006pH-00 for ; Sun, 16 Feb 2003 06:08:07 +0100 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 76 Original-NNTP-Posting-Host: 38.0012159.lodgenet.net Original-X-Trace: quimby.gnus.org 1045372087 26242 12.18.119.38 (16 Feb 2003 05:08:07 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 16 Feb 2003 05:08:07 GMT User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 Cancel-Lock: sha1:Jj4bjNWM53Ddq6xkrYsU50LhCjM= Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:50138 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:50138 Ted Zlatanov writes: > On Fri, 14 Feb 2003, niklas.morberg@axis.com wrote: >> Ted Zlatanov writes: >> >>> I have the following in spam.el: >>> >>> (let ((articles gnus-newsgroup-articles) >>> article tomove) >>> (dolist (article articles) >>> (gnus-summary-remove-process-mark article) >>> (when (eq (gnus-summary-article-mark article) gnus-spam-mark) >>> (gnus-summary-mark-article article gnus-expirable-mark) >>> (push article tomove)))) >>> >>> but it produces errors "Can't find article %d" for every article >>> that is in the newsgroup, but is not visible when >>> gnus-summary-remove-process-mark runs (at least, I think that's the >>> problem). Is there a better way of doing the removal of the >>> process mark from all articles? >> >> I don't know this at all, but greping for g-s-r-p-m seems to >> indicate that you don't populate articles in the same way as >> most other implementations in gnus. The common case seems to >> be: >> >> (let ((articles (gnus-summary-work-articles n)) >> >> Could that be it? > > This is what you call when you want to get the articles the user wants > you to work with; gnus-summary-move-article would use this for > instance. What I want instead is the list of articles in the group > that are visible to the user, assuming that the user only cares about > those articles to be processed when he exits the group. It seems, > from looking at the gnus-summary-work-articles source, that I have to > go through the summary buffer line by line and ask for the article > number of each line. That seems like a very clumsy way to do it, and > I would like to avoid it in favor of a more reusable approach if one > exists. > > To sum up what I need: I need to go through the articles visible in > the summary buffer and a) take the process-mark off, and b) set the > process-mark on those that match some criteria. Later I call > gnus-summary-move-article and it will operate on those process-marked > articles. Have you tried gnus-newsgroup-headers? If you haven't, you should definitely look at how gnus-sum.el uses it as there is an entire set of accessor macros. As for manipulating the process mark, I did much the same thing in gnus-agent-summary-fetch-series (gnus-agent.el). If you're simply wanting to temporarily override the user's process marks, you can get by with a simple binding. For example, (let ((gnus-newsgroup-processable (my-processable-list-generator gnus-newsgroup-headers))) (gnus-summary-move-article nil ...)) There is a minor bug with this sample. If you move an article that the user had marked processable, that article is still in the user's processable list after moving. If you are truely doing this while exiting the summary, this shouldn't be a problem. Still, this would be a little safer. (setq gnus-newsgroup-processable (let* ((original-processable gnus-newsgroup-processable) (gnus-newsgroup-processable (my-processable-list-generator gnus-newsgroup-headers))) (gnus-summary-move-article nil ...) (gnus-set-difference original-processable gnus-newsgroup-processable))) Kevin