aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Haselwarter <philipp.haselwarter@gmx.de>2011-01-02 14:56:28 +0100
committerYuri D'Elia <wavexx@thregr.org>2011-01-02 19:46:05 +0100
commit63aa1737e07b398e8e4d31c6ed5a16c0f35be202 (patch)
tree547a290dc733201884f3453a0361a5bb33140692
parent22eb2101f5db6adfaa823de971616e8d6a383e00 (diff)
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)'.
-rw-r--r--gnus-desktop-notify.el16
1 files changed, 8 insertions, 8 deletions
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