Gnus development mailing list
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
Subject: Re: Select first *unseen* unread message in summary buffer?
Date: Mon, 14 Jan 2002 17:17:16 +1100	[thread overview]
Message-ID: <87ofjx5udv.fsf@inanna.rimspace.net> (raw)
In-Reply-To: <m3g05uvldi.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Sat, 29 Dec 2001 02:57:29 +0100")

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

On Sat, 29 Dec 2001, Lars Magne Ingebrigtsen wrote:
> Lars Magne Ingebrigtsen <larsi@gnus.org> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2274 bytes --]

--- 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

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]


-- 
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

  reply	other threads:[~2002-01-14  6:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-05  5:39 Daniel Pittman
2001-12-05  5:56 ` Matt Armstrong
2001-12-05  9:11   ` Colin Marquardt
2001-12-05  9:20   ` Daniel Pittman
2001-12-05 10:37     ` Martin Monsorno
2001-12-05 11:33       ` Daniel Pittman
2001-12-05 16:51       ` Matt Armstrong
2001-12-05  8:57 ` Kai Großjohann
2001-12-05  9:22   ` Daniel Pittman
2001-12-07 14:29 ` Simon Josefsson
2001-12-08  8:56   ` Daniel Pittman
2001-12-29  1:32     ` Lars Magne Ingebrigtsen
2001-12-29  1:57       ` Lars Magne Ingebrigtsen
2002-01-14  6:17         ` Daniel Pittman [this message]
2002-01-19 22:34           ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ofjx5udv.fsf@inanna.rimspace.net \
    --to=daniel@rimspace.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).