From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/14500 Path: news.gmane.org!not-for-mail From: Philipp Haselwarter Newsgroups: gmane.emacs.gnus.user Subject: Re: Gnus and new mail notification Date: Sun, 02 Jan 2011 13:02:09 +0100 Message-ID: <878vz31pku.fsf@nzebook.haselwarter.org> References: <87y67evj9j.fsf@savara.sat.thregr.org> <871v54mgzt.fsf@savara.sat.thregr.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1293969762 19475 80.91.229.12 (2 Jan 2011 12:02:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 2 Jan 2011 12:02:42 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sun Jan 02 13:02:34 2011 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PZMdt-0005Cb-Ii for gegu-info-gnus-english@m.gmane.org; Sun, 02 Jan 2011 13:02:33 +0100 Original-Received: from localhost ([127.0.0.1]:33971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZMdt-0000O3-14 for gegu-info-gnus-english@m.gmane.org; Sun, 02 Jan 2011 07:02:33 -0500 Original-Received: from [140.186.70.92] (port=60106 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZMdp-0000No-LI for info-gnus-english@gnu.org; Sun, 02 Jan 2011 07:02:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZMdo-0005Yh-1L for info-gnus-english@gnu.org; Sun, 02 Jan 2011 07:02:29 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:34737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZMdn-0005Yc-6h for info-gnus-english@gnu.org; Sun, 02 Jan 2011 07:02:27 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PZMdk-00057C-42 for info-gnus-english@gnu.org; Sun, 02 Jan 2011 13:02:24 +0100 Original-Received: from pd9ecf6bf.dip.t-dialin.net ([217.236.246.191]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 02 Jan 2011 13:02:24 +0100 Original-Received: from philipp.haselwarter by pd9ecf6bf.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 02 Jan 2011 13:02:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 67 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: pd9ecf6bf.dip.t-dialin.net X-NSA-Fodder: $400 million in gold bullion mailbomb global Osama X-Meat: Biltong User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:y9sHU7RMDGlZe7PltR8NnsVGsMc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:14500 Archived-At: 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 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 "
%d:%s" `---- 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