From 80016d6e511bc886105692e44a8408c044b0c003 Mon Sep 17 00:00:00 2001 From: Ulf Jasper Date: Sat, 24 Jan 2009 10:39:34 +0000 Subject: [PATCH] newsticker: Fixed next-new-or-immortal-feed even more. --- lisp/ChangeLog | 8 ++++++++ lisp/net/newst-treeview.el | 39 ++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a8f7c56e3dd..8f3e42ab05a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2009-01-24 Ulf Jasper + + * 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 * term/ns-win.el (menu-bar-select-frame): Drop this override. diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index ce4764eac93..66c075d0f7d 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -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) -- 2.39.2