]> git.eshelyaron.com Git - emacs.git/commitdiff
newsticker: Fixed next-new-or-immortal-feed even more.
authorUlf Jasper <ulf.jasper@web.de>
Sat, 24 Jan 2009 10:39:34 +0000 (10:39 +0000)
committerUlf Jasper <ulf.jasper@web.de>
Sat, 24 Jan 2009 10:39:34 +0000 (10:39 +0000)
lisp/ChangeLog
lisp/net/newst-treeview.el

index a8f7c56e3ddba44f7049072ae1012847d1cdbf91..8f3e42ab05a97ef0a0d2ae5dfbc1e54d6922075c 100644 (file)
@@ -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.
index ce4764eac934840a07688e7032c58ba0b1c17385..66c075d0f7de68f30a5f1630760ac4812206532a 100644 (file)
@@ -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 @@ new or immortal."
                   (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 @@ is activated."
           (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 @@ Return t if a new feed was activated, nil otherwise."
   (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 @@ return a nested list."
                   (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)