From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/49190 Path: main.gmane.org!not-for-mail From: Lloyd Zusman Newsgroups: gmane.emacs.gnus.general Subject: Re: A solution that's better than my ugly hack? Date: Mon, 13 Jan 2003 16:04:27 -0500 Organization: FreeBSD/Linux Hippopotamus Preserve Sender: owner-ding@hpc.uh.edu Message-ID: <864r8cep7o.fsf@asfast.com> References: <86fzsc4ii2.fsf@asfast.com> <84k7hnjxqi.fsf@lucy.cs.uni-dortmund.de> <86y9638l7i.fsf@asfast.com> <86ptrfc6oy.fsf@asfast.com> <86hecrc56e.fsf@asfast.com> <86el7vc4xw.fsf@asfast.com> <8665t6de1c.fsf@asfast.com> <8665t4bwp2.fsf@asfast.com> <8665ssevka.fsf_-_@asfast.com> <861y3geuyx.fsf@asfast.com> <86vg0sdf5v.fsf@asfast.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1042491870 32207 80.91.224.249 (13 Jan 2003 21:04:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 13 Jan 2003 21:04:30 +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 18YBky-0008NJ-00 for ; Mon, 13 Jan 2003 22:04:29 +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 18YBlG-00032P-00; Mon, 13 Jan 2003 15:04:46 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 13 Jan 2003 15:05:43 -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 PAA02995 for ; Mon, 13 Jan 2003 15:05:29 -0600 (CST) Original-Received: (qmail 69405 invoked by alias); 13 Jan 2003 21:04:29 -0000 Original-Received: (qmail 69400 invoked from network); 13 Jan 2003 21:04:28 -0000 Original-Received: from home.acholado.net (HELO home) (Potamus@216.27.138.216) by 66.230.238.6 with SMTP; 13 Jan 2003 21:04:28 -0000 Original-Received: from localhost (localhost [127.0.0.1]) (uid 1001) by home with local; Mon, 13 Jan 2003 16:04:27 -0500 Original-To: ding@gnus.org X-Face: "!ga1s|?LNLE3MeeeEYs(%LIl9q[xV9!j4#xf4!**BFW_ihlOb;:Slb>)vy>CJM writes: > Lloyd Zusman writes: > >> And this brings up one more question: for the list of articles that gets >> passed to `gnus-alter-articles-to-read-function', how do I tell which >> of these articles are unread, and which are already read? > > (memq article gnus-newsgroup-reads) > > and stuff like that should do the trick. And it indeed did do the trick. Here's my solution: (defvar ljz-group-default-display-count 256 "*Default count of articles to display when entering a group, if there are no unread, dormant, or ticked articles, and if there is no prefix argument.") (defun ljz-alter-articles-to-read-function (group article-list) (let* ((count 0) (prefix (if (listp current-prefix-arg) (car current-prefix-arg) current-prefix-arg)) (test-count (if prefix prefix ljz-group-default-display-count)) newlist article) (if (or (null test-count) (<= test-count 0)) article-list (while article-list (setq article (car article-list)) (setq article-list (cdr article-list)) (when (or (memq article gnus-newsgroup-unreads) (memq article gnus-newsgroup-marked) (memq article gnus-newsgroup-dormant) (<= (setq count (1+ count )) test-count)) (setq newlist (append newlist (list article))))) newlist))) I then customized `gnus-alter-articles-to-read-function' to contain 'ljz-alter-articles-to-read-function, and it works great! Thanks again. -- Lloyd Zusman ljz@asfast.com