changeset 101870:085bed32d1c1

newsticker: fix infinite recursion when moving to next new item
author Ulf Jasper <ulf.jasper@web.de>
date Sat, 07 Feb 2009 13:24:06 +0000
parents 5be87badd8fd
children cf870c811594
files lisp/ChangeLog lisp/net/newst-treeview.el
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Feb 07 13:07:38 2009 +0000
+++ b/lisp/ChangeLog	Sat Feb 07 13:24:06 2009 +0000
@@ -1,3 +1,9 @@
+2009-02-07  Ulf Jasper  <ulf.jasper@web.de>
+
+	* net/newst-treeview.el
+	(newsticker-treeview-next-new-or-immortal-item): New arg
+	DONT-WRAP-TREES to prevent infinite recursion.
+
 2009-02-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* mail/rmailedit.el (rmail-cease-edit): narrow-to-region before
--- a/lisp/net/newst-treeview.el	Sat Feb 07 13:07:38 2009 +0000
+++ b/lisp/net/newst-treeview.el	Sat Feb 07 13:24:06 2009 +0000
@@ -7,7 +7,7 @@
 ;; URL:         http://www.nongnu.org/newsticker
 ;; Created:     2007
 ;; Keywords:    News, RSS, Atom
-;; Time-stamp:  "24. Januar 2009, 11:22:20 (ulf)"
+;; Time-stamp:  "7. Februar 2009, 11:46:00 (ulf)"
 
 ;; ======================================================================
 
@@ -1314,7 +1314,8 @@
   (newsticker-treeview-show-item))
 
 (defun newsticker-treeview-next-new-or-immortal-item (&optional
-                                                      current-item-counts)
+                                                      current-item-counts
+                                                      dont-wrap-trees)
   "Move to next new or immortal item.
 Will move to next feed until an item is found.  Will not move if
 optional argument CURRENT-ITEM-COUNTS is t and current item is
@@ -1337,9 +1338,10 @@
                   (newsticker-treeview-show-item)
                   (throw 'found t))
                 (setq move t))))
-    (when (or (newsticker-treeview-next-feed t)
-              (newsticker--treeview-first-feed))
-      (newsticker-treeview-next-new-or-immortal-item t))))
+    (let ((wrap-trees (not dont-wrap-trees)))
+      (when (or (newsticker-treeview-next-feed t)
+                (and wrap-trees (newsticker--treeview-first-feed)))
+        (newsticker-treeview-next-new-or-immortal-item t t)))))
 
 (defun newsticker-treeview-prev-new-or-immortal-item ()
   "Move to previous new or immortal item.