Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Philipp Haselwarter <philipp.haselwarter@gmx.de>
To: info-gnus-english@gnu.org
Subject: Re: Gnus and new mail notification
Date: Sun, 02 Jan 2011 13:02:09 +0100	[thread overview]
Message-ID: <878vz31pku.fsf@nzebook.haselwarter.org> (raw)
In-Reply-To: <871v54mgzt.fsf@savara.sat.thregr.org>

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	other threads:[~2011-01-02 12:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-24 23:33 Yuri D'Elia
2010-12-25 13:10 ` Philipp Haselwarter
2010-12-25 15:26   ` Yuri D'Elia
2010-12-25 21:52     ` Tassilo Horn
2010-12-26 20:11 ` Yuri D'Elia
2011-01-02 12:02   ` Philipp Haselwarter [this message]
     [not found] <mailman.26.1293233609.7272.info-gnus-english@gnu.org>
2010-12-25 13:25 ` e20100633
2010-12-26 18:26   ` Philipp Haselwarter
2010-12-26 18:59     ` Philipp Haselwarter
2010-12-25 20:31 ` Richard Riley
2010-12-25 21:55   ` Tassilo Horn
2010-12-25 22:56   ` Yuri D'Elia
     [not found]   ` <mailman.13.1293317806.24913.info-gnus-english@gnu.org>
2010-12-25 23:19     ` Richard Riley
2010-12-26 16:22       ` Yuri D'Elia
     [not found]       ` <mailman.1.1293380566.6185.info-gnus-english@gnu.org>
2010-12-27  8:11         ` Richard Riley
2010-12-27  9:25           ` Thierry Volpiatto
     [not found]           ` <mailman.2.1293441979.18751.info-gnus-english@gnu.org>
2010-12-27 13:30             ` Richard Riley
2010-12-27 15:39               ` Philipp Haselwarter
2010-12-27 16:04               ` Thierry Volpiatto
     [not found]               ` <mailman.8.1293465927.24495.info-gnus-english@gnu.org>
2010-12-27 16:42                 ` Richard Riley
2010-12-27 17:47                   ` Thierry Volpiatto
     [not found]                   ` <mailman.19.1293472126.24495.info-gnus-english@gnu.org>
2010-12-27 18:11                     ` Richard Riley
2010-12-27 19:09                       ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878vz31pku.fsf@nzebook.haselwarter.org \
    --to=philipp.haselwarter@gmx.de \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).