Browse Source

Merge branch 'maint'

Nicolas Goaziou 1 year ago
parent
commit
d89e35ee50
1 changed files with 15 additions and 8 deletions
  1. 15 8
      lisp/org-feed.el

+ 15 - 8
lisp/org-feed.el

@@ -276,14 +276,21 @@ have been saved."
 (defun org-feed-update-all ()
   "Get inbox items from all feeds in `org-feed-alist'."
   (interactive)
-  (let ((nfeeds (length org-feed-alist))
-	(nnew (apply '+  (mapcar 'org-feed-update org-feed-alist))))
-    (message "%s from %d %s"
-	     (cond ((= nnew 0) "No new entries")
-		   ((= nnew 1) "1 new entry")
-		   (t (format "%d new entries" nnew)))
-	     nfeeds
-	     (if (= nfeeds 1) "feed" "feeds"))))
+  (let ((entries 0)
+	(errors 0)
+	(total-feeds (length org-feed-alist)))
+    (dolist (feed org-feed-alist)
+      (let ((items (ignore-errors (org-feed-update feed))))
+	(if items (cl-incf entries items)
+	  (cl-incf errors))))
+    (message "%s from %d %s%s"
+	     (pcase entries
+	       (0 "No new entries")
+	       (1 "1 new entry")
+	       (_ (format "%d new entries" entries)))
+	     total-feeds
+	     (if (= total-feeds 1) "feed" "feeds")
+	     (if (= 0 errors) "" (format " (unavailable feeds: %d)" errors)))))
 
 ;;;###autoload
 (defun org-feed-update (feed &optional retrieve-only)