info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnus and new mail notification


From: Philipp Haselwarter
Subject: Re: Gnus and new mail notification
Date: Sun, 02 Jan 2011 13:02:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

I found that

,----
| (gnus-group-unread (car g))
`----
sometimes yields nil, resulting in

,----
| let*: Wrong type argument: number-or-marker-p, nil
| 
| Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
|   +(3 nil)
|   (let* ((name (gnus-info-group g)) (unread (gnus-group-unread (car g)))
|   (count (+ read unread))))
`----

Initially I wasn't able to reproduce the behaviour but yesterday and
today it reoccurred, I wasn't able to track it down though.

Anyways, here's what I did to work around it:

--8<---------------cut here---------------start------------->8---
commit 6483c4b075539db1880c5d8a834caf7c9e902b1d (HEAD, refs/heads/check_count)
Author: Philipp Haselwarter <philipp.haselwarter@gmx.de>
Date:   Thu Dec 30 16:04:36 2010 +0100

    [Bugfix] 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)'.

        Modified gnus-desktop-notify.el
diff --git a/gnus-desktop-notify.el b/gnus-desktop-notify.el
index 5aef4bb..2ec8cbb 100644
--- a/gnus-desktop-notify.el
+++ b/gnus-desktop-notify.el
@@ -199,7 +199,7 @@ with the behavior defined by 
`gnus-desktop-notify-send-mode'."
                     (cdr (gnus-info-read g)))) )
        (when read
          (let* ( (name (gnus-info-group g))
-                 (unread (gnus-group-unread (car g)))
+                 (unread (or (gnus-group-unread name) 0))
                  (count (+ read unread))
                  (old-count (cdr (assoc name gnus-desktop-notify-counts)))
                  (notify (gnus-group-find-parameter name 'group-notify)) )
--8<---------------cut here---------------end--------------->8---



Furthermore, the markup you use in `gnus-desktop-notify-send':
,----
| (format "<br/><tt> <b>%d</b>:<b>%s</b></tt>"
`----
does not work at all with notify-send for me, it just gets displayed
literally, which is not-so-pretty..
,----
| % notify-send -v
| notify-send 0.5.2
`----



-- 
Philipp Haselwarter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]