changeset 101428:d7b1d5b3b2c1

newsticker: Fixed next-new-or-immortal-feed even more.
author Ulf Jasper <ulf.jasper@web.de>
date Sat, 24 Jan 2009 10:39:34 +0000
parents 1b7286db7263
children 57e8989174eb
files lisp/ChangeLog lisp/net/newst-treeview.el
diffstat 2 files changed, 29 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jan 24 10:27:03 2009 +0000
+++ b/lisp/ChangeLog	Sat Jan 24 10:39:34 2009 +0000
@@ -1,3 +1,11 @@
+2009-01-24  Ulf Jasper  <ulf.jasper@web.de>
+
+	* net/newst-treeview.el (newsticker--treeview-first-feed): New.
+	(newsticker-treeview-next-new-or-immortal-item): Try first-feed if
+	next-feed does not succeed.  Fixes bug#1710 even more.
+	(newsticker-treeview-next-feed): Simplified.
+	(newsticker--group-get-feeds): Suppress group names in result.
+
 2009-01-24  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
 	* term/ns-win.el (menu-bar-select-frame): Drop this override.
--- a/lisp/net/newst-treeview.el	Sat Jan 24 10:27:03 2009 +0000
+++ b/lisp/net/newst-treeview.el	Sat Jan 24 10:39:34 2009 +0000
@@ -7,7 +7,7 @@
 ;; URL:         http://www.nongnu.org/newsticker
 ;; Created:     2007
 ;; Keywords:    News, RSS, Atom
-;; Time-stamp:  "22. Januar 2009, 21:22:25 (ulf)"
+;; Time-stamp:  "24. Januar 2009, 11:22:20 (ulf)"
 
 ;; ======================================================================
 
@@ -1337,7 +1337,8 @@
                   (newsticker-treeview-show-item)
                   (throw 'found t))
                 (setq move t))))
-    (when (newsticker-treeview-next-feed t)
+    (when (or (newsticker-treeview-next-feed t)
+              (newsticker--treeview-first-feed))
       (newsticker-treeview-next-new-or-immortal-item t))))
 
 (defun newsticker-treeview-prev-new-or-immortal-item ()
@@ -1542,6 +1543,11 @@
           (node
            (widget-apply-action node)))))
 
+(defun newsticker--treeview-first-feed ()
+  "Jump to the depth-first feed in the newsticker-groups tree." 
+  (newsticker-treeview-jump
+   (car (reverse (newsticker--group-get-feeds newsticker-groups t)))))
+
 (defun newsticker-treeview-next-feed (&optional stay-in-tree)
   "Move to next feed.
 Optional argument STAY-IN-TREE prevents moving from real feed
@@ -1551,21 +1557,18 @@
   (newsticker--treeview-restore-layout)
   (let ((cur (newsticker--treeview-get-current-node))
         (new nil))
-    (if cur
-      (progn
-        (setq new
-              (if cur
-                  (or (newsticker--treeview-get-next-sibling cur)
-                      (newsticker--treeview-get-next-uncle cur)
-                      (and (not stay-in-tree)
-                           (newsticker--treeview-get-other-tree)))
-                (car (widget-get newsticker--treeview-feed-tree :children))))
-        (if new
-            (progn
-              (newsticker--treeview-activate-node new)
-              (newsticker--treeview-tree-update-highlight)
-              (not (eq new cur)))
-          nil))
+    (setq new
+          (if cur
+              (or (newsticker--treeview-get-next-sibling cur)
+                  (newsticker--treeview-get-next-uncle cur)
+                  (and (not stay-in-tree)
+                       (newsticker--treeview-get-other-tree)))
+            (car (widget-get newsticker--treeview-feed-tree :children))))
+    (if new
+        (progn
+          (newsticker--treeview-activate-node new)
+          (newsticker--treeview-tree-update-highlight)
+          (not (eq new cur)))
       nil)))
 
 (defun newsticker-treeview-prev-feed (&optional stay-in-tree)
@@ -1719,7 +1722,7 @@
                   (let ((subfeeds (newsticker--group-get-feeds n t)))
                     (when subfeeds
                       (setq result (append subfeeds result)))))))
-          group)
+          (cdr group))
     result))
 
 (defun newsticker-group-add-group (name parent)