From 63aa1737e07b398e8e4d31c6ed5a16c0f35be202 Mon Sep 17 00:00:00 2001 From: Philipp Haselwarter Date: Sun, 2 Jan 2011 14:56:28 +0100 Subject: gnus-desktop-notify-check Make `gnus-desktop-notify-check' more robust to another data inconsistency: `(gnus-group-unread (car g))' sometimes yields nil, causing `(count (+ read unread))' to fail. The fix returns 0 instead of nil and uses `name' instead of `(car g)'. --- gnus-desktop-notify.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gnus-desktop-notify.el') diff --git a/gnus-desktop-notify.el b/gnus-desktop-notify.el index a8373e0..bb54e5d 100644 --- a/gnus-desktop-notify.el +++ b/gnus-desktop-notify.el @@ -193,14 +193,14 @@ with the behavior defined by `gnus-desktop-notify-send-mode'." (interactive) (let ( (updated-groups '()) ) (dolist (g gnus-newsrc-alist) - (let ( (read (or - (and (listp (car (gnus-info-read g))) - (cdar (gnus-info-read g))) - (cdr (gnus-info-read g)))) ) - (when read - (let* ( (name (gnus-info-group g)) - (unread (gnus-group-unread (car g))) - (count (+ read unread)) + (let* ( (name (gnus-info-group g)) + (read (or + (and (listp (car (gnus-info-read g))) + (cdar (gnus-info-read g))) + (cdr (gnus-info-read g)))) + (unread (gnus-group-unread name)) ) + (when (and (numberp read) (numberp unread)) + (let* ( (count (+ read unread)) (old-count (cdr (assoc name gnus-desktop-notify-counts))) (notify (gnus-group-find-parameter name 'group-notify)) ) (when (or -- cgit v1.2.3