From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/41958 Path: main.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.gnus.general Subject: Re: Select first *unseen* unread message in summary buffer? Date: Mon, 14 Jan 2002 17:17:16 +1100 Organization: Not today, thank you, Mother. Sender: owner-ding@hpc.uh.edu Message-ID: <87ofjx5udv.fsf@inanna.rimspace.net> References: <87zo4yns3m.fsf@inanna.rimspace.net> <87snamccof.fsf@inanna.rimspace.net> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035177272 8845 80.91.224.250 (21 Oct 2002 05:14:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:14:32 +0000 (UTC) Return-Path: Original-Received: (qmail 6464 invoked from network); 14 Jan 2002 06:19:05 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 14 Jan 2002 06:19:05 -0000 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 16Q0S4-0007fR-00; Mon, 14 Jan 2002 00:18:36 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 14 Jan 2002 00:18:27 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id AAA13603 for ; Mon, 14 Jan 2002 00:18:15 -0600 (CST) Original-Received: (qmail 6455 invoked by alias); 14 Jan 2002 06:18:17 -0000 Original-Received: (qmail 6450 invoked from network); 14 Jan 2002 06:18:16 -0000 Original-Received: from melancholia.rimspace.net (HELO melancholia.danann.net) (210.23.138.19) by gnus.org with SMTP; 14 Jan 2002 06:18:16 -0000 Original-Received: from localhost (melancholia.rimspace.net [210.23.138.19]) by melancholia.danann.net (Postfix) with ESMTP id 5ACFF2A812 for ; Mon, 14 Jan 2002 17:18:00 +1100 (EST) Original-Received: by localhost (Postfix, from userid 1000) id 1000F8214F; Mon, 14 Jan 2002 17:17:16 +1100 (EST) Original-To: ding@gnus.org In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sat, 29 Dec 2001 02:57:29 +0100") Original-Lines: 34 User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.5 (bamboo, i686-pc-linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:41958 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:41958 --=-=-= On Sat, 29 Dec 2001, Lars Magne Ingebrigtsen wrote: > Lars Magne Ingebrigtsen writes: > >> I suggest splitting this up into two variables. >> >> 1) gnus-auto-select-subject, which says what subject line point >> should be placed on >> 2) gnus-auto-select-article, which says whether the article should >> be selected > > I've now done this, but I kept `gnus-auto-select-first' as the name of > the latter variable to keep some easy semblance of > backwards-compatibility. And I've added `unseen' as a value to the > former variable. Funky. Thank you for that. The attached patch implements an additional option for 'gnus-auto-select-subject', 'unseen-or-unread'. As the name suggests, this selects the first unseen article, but, if no unseen articles exist, the first unread article. It's probably not the cleanest way of implementing this but it works. :) Daniel --=-=-= Content-Type: text/x-patch Content-Disposition: attachment --- working directory: /home/daniel/.xemacs/xemacs-packages/gnus/lisp/ % socksify cvs diff gnus-sum.el Index: gnus-sum.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 6.163 diff -u -r6.163 gnus-sum.el --- gnus-sum.el 2002/01/12 00:10:55 6.163 +++ gnus-sum.el 2002/01/14 06:12:43 @@ -295,13 +295,16 @@ first subject), `unread' (place point on the subject line of the first unread article), `best' (place point on the subject line of the higest-scored article), `unseen' (place point on the subject line of -the first unseen article), or a function to be called to place point on -some subject line.." +the first unseen article), 'unseen-or-unread' (place point on the subject +line of the first unseen article or, if all article have been seen, on the +subject line of the first unread article), or a function to be called to +place point on some subject line.." :group 'gnus-group-select :type '(choice (const best) (const unread) (const first) - (const unseen))) + (const unseen) + (const unseen-or-unread))) (defcustom gnus-auto-select-next t "*If non-nil, offer to go to the next group from the end of the previous. @@ -3326,6 +3329,8 @@ (gnus-summary-first-unread-subject)) ((eq gnus-auto-select-subject 'unseen) (gnus-summary-first-unseen-subject)) + ((eq gnus-auto-select-subject 'unseen-or-unread) + (gnus-summary-first-unseen-or-unread-subject)) ((eq gnus-auto-select-subject 'first) ;; Do nothing. ) @@ -6846,6 +6851,19 @@ (when (gnus-summary-first-subject t t t) (gnus-summary-show-thread) (gnus-summary-first-subject t t t)) + (gnus-summary-position-point))) + +(defun gnus-summary-first-unseen-or-unread-subject () + "Place the point on the subject line of the first unseen article. +Return nil if there are no unseen articles." + (interactive) + (prog1 + (unless (when (gnus-summary-first-subject t t t) + (gnus-summary-show-thread) + (gnus-summary-first-subject t t t)) + (when (gnus-summary-first-subject t) + (gnus-summary-show-thread) + (gnus-summary-first-subject t))) (gnus-summary-position-point))) (defun gnus-summary-first-article () Exit 1 17:11:40 --=-=-= -- If a voice inside tells you that you are not a painter, then by all means paint! And that voice will be silenced... -- Vincent Van Gogh --=-=-=--