From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/13919 Path: main.gmane.org!not-for-mail From: Wes Hardaker Newsgroups: gmane.emacs.gnus.general Subject: Re: display 'not-expired Date: 11 Feb 1998 12:01:16 -0800 Organization: U.C.Davis, Information Technology - D.C.A.S. Sender: owner-ding@hpc.uh.edu Message-ID: References: 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 1035153198 11875 80.91.224.250 (20 Oct 2002 22:33:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:33:18 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id MAA03158 for ; Wed, 11 Feb 1998 12:12:10 -0800 Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by xemacs.org (8.8.5/8.8.5) with ESMTP id OAA16719 for ; Wed, 11 Feb 1998 14:08:50 -0600 (CST) Original-Received: from sina.hpc.uh.edu (sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.7.6/8.7.3) with ESMTP id OAN14367; Wed, 11 Feb 1998 14:44:29 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 11 Feb 1998 14:07:12 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by sina.hpc.uh.edu (8.7.3/8.7.3) with SMTP id OAA15764 for ; Wed, 11 Feb 1998 14:06:38 -0600 (CST) Original-Received: (qmail 5820 invoked by uid 504); 11 Feb 1998 20:06:34 -0000 Original-Received: (qmail 5809 invoked from network); 11 Feb 1998 20:06:32 -0000 Original-Received: from des.castles.com (hardaker@208.214.166.35) by claymore.vcinet.com with SMTP; 11 Feb 1998 20:06:29 -0000 Original-Received: (from hardaker@localhost) by des.castles.com (8.8.6/8.8.6) id MAA09205; Wed, 11 Feb 1998 12:01:42 -0800 Original-To: ding@gnus.org X-Face: #qW^}a%m*T^{A:Cp}$R\"38+d}41-Z}uU8,r%F#c#s:~Nzp0G9](s?,K49KJ]s"*7gvRgA SrAvQc4@/}L7Qc=w{)]ACO\R{LF@S{pXfojjjGg6c;q6{~C}CxC^^&~(F]`1W)%9j/iS/ IM",B1M.?{w8ckLTYD'`|kTr\i\cgY)P4 X-url: http://dcas.ucdavis.edu/~hardaker In-Reply-To: Lars Magne Ingebrigtsen's message of "19 Dec 1997 21:21:53 +0100" X-Mailer: Quassia Gnus v0.23/XEmacs 20.3 - "Vatican City" Original-Xref: des.castles.com queue:14 Original-Lines: 78 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:13919 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:13919 >> Yep. I didn't do it because it was going to take me too long to >> figure out how to map a article mark into a list of articles that have >> it. If you can point me at the functions I need, I'd be happy to do >> it correctly... Lars> There is no such mapping function, but you can do it the other way Lars> around. `(gnus-summary-article-mark ARTICLE)' will return the mark of Lars> ARTICLE, and you can iterate over `gnus-newsgroup-headers' to find all Lars> the article numbers. Ok, I'm back to hacking on this problem again (I'm trying to allow the display parameter to be set to things like "-E" as a reminder), but I ran into a couple snags: 1) gnus-summary-article-mark always returns 'nil, which I believe is because the information hasn't been set yet. 2) I switched to gnus-article-mark, but that seems off too, and it marks a bunch of articles with marks that don't have it. Here's the current code. Tell me where I went wrong: (defun gnus-articles-to-read (group &optional read-all) ;; Find out what articles the user wants to read. (let* ((display (gnus-group-find-parameter group 'display)) tmparticles artmark (articles ;; Select all articles if `read-all' is non-nil, or if there ;; are no unread articles. (cond ((or read-all (and (zerop (length gnus-newsgroup-marked)) (zerop (length gnus-newsgroup-unreads))) (eq display 'all)) (gnus-uncompress-range (gnus-active group))) ((stringp display) (message gnus-newsgroup-headers) (setq tmparticles (gnus-uncompress-range (gnus-active group))) (setq articles nil) (if (string-equal (substring display 0 1) "-") (progn (setq display (substring display 1)) (while (not (null tmparticles)) (setq artmark (char-to-string (gnus-article-mark (car tmparticles)))) (if (or (not artmark) (not (string-match artmark display))) (setq articles (append (list (car tmparticles)) articles))) (setq tmparticles (cdr tmparticles)))) (while (not (null tmparticles)) (setq artmark (char-to-string (gnus-article-mark (car tmparticles)))) (if (and artmark (string-match artmark display)) (setq articles (append (list (car tmparticles)) articles))) (setq tmparticles (cdr tmparticles)))) articles) ((eq display 'not-expired) (setq articles (gnus-uncompress-range (gnus-active group))) (setq tmparticles gnus-newsgroup-expirable) (while (not (null tmparticles)) (setq articles (delq (car tmparticles) articles)) (setq tmparticles (cdr tmparticles))) articles) (t (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked (copy-sequence gnus-newsgroup-unreads)) '<)))) (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) (scored (length scored-list)) .... -- "Ninjas aren't dangerous. They're more afraid of you than you are of them."