From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Proposed changes to gnus-notifications.el Date: Sun, 21 Jul 2019 12:40:17 +0200 Message-ID: <87wogbisby.fsf@gmx.de> References: <87y30s5hv4.fsf@tcd.ie> <87blxnke8f.fsf@gmx.de> <87wogbraj0.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="36442"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Julien Danjou , Lars Ingebrigtsen , emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 21 12:40:42 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hp9Gj-0009Mg-Jg for ged-emacs-devel@m.gmane.org; Sun, 21 Jul 2019 12:40:42 +0200 Original-Received: from localhost ([::1]:55324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hp9Gi-00075c-E4 for ged-emacs-devel@m.gmane.org; Sun, 21 Jul 2019 06:40:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60840) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hp9Ga-00075K-Bg for emacs-devel@gnu.org; Sun, 21 Jul 2019 06:40:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hp9GZ-00074r-9P for emacs-devel@gnu.org; Sun, 21 Jul 2019 06:40:32 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:38095) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hp9GY-00072D-Ro for emacs-devel@gnu.org; Sun, 21 Jul 2019 06:40:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1563705618; bh=Q+d+NGvPn/S10VCvepIU8ExAOl/mD71cTDxVWojq/3E=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Wv1bSRkhNS8nE6ihZz0Qbnlh/dZkpLt3o5GDweoAUHOsyoaYJ0oqWTjPF3Y4DJv+Y 26dTdSqjSetq1XDj5rArOaacE1xPgmeVMkUYkuInqUpmCRAHvPbQfxbrzWQjT8KTss i6qvIdO1BfsK2nJaw8pD7L7bYRggySj0TaBMMpUs= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([212.91.238.185]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MRGvT-1hzqvt1Y7z-00Udns; Sun, 21 Jul 2019 12:40:18 +0200 In-Reply-To: <87wogbraj0.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 21 Jul 2019 10:40:03 +0100") X-Provags-ID: V03:K1:2f1scsJbOFZDyzlZHILvqTHab8fLx5uXxl7AbZhumJbqSy0mVCF LHY0WGC2p+sGpQ31oAbWDh7REtmbiemzy9bcKAsnTP2Gma1xPRUS7tUd9YO2YclOYDxRBCm Zq10s/rJMdPvV7UqERt3+yllOE7Nj0SiDleqy1QDDKWedgH2GGfIAQvbIsMpB4A3+4sJtLw 86wvylBQODHgm2okxVFgg== X-UI-Out-Filterresults: notjunk:1;V03:K0:wHentos8ww4=:TNHl+2tDNZDnbioxXRzyUZ o8r2vKMEtd/ER0idkAHEv4auaVqfVtZj9Fb+6LAc5aQhKqfRnm3ycvm1OCMNfdrHNSNFYMHQA T5BVEca5iChQtc9R6d+Ap8j918yG/7qfG63TSXZl2W1xmisFUSWG5rUgntPIeNGddx3taA4SB YzBtwekiwkmVyW01K3w+PVb3nVvoYcFNIIatP9qpkJRULziHpECOQdo1k34dAWXK55azYmiyB /1Rh0vZ3gVN2kfGIyRMJP7N9PO8TsFYE/mbvyXYEI+onrZcfhdEaJ2CXmr7UtQ53IMeBGdYAF D+TLoql+383KDI/EoYJ+FtKyX/uZg5R9F9IOVTFqZC9wZ2kTVQZsslep7NEFBNENngdY5HxAx neOWgSjx4VEC8og0fUi4SMDggsjYR9UPcnfHcfeG7I/+tiFsqH1hr8LalXgZCRSBzqsGYL8RA IvPuGdZ/hBZ+oXOblj9h7T6pk+2YyBE6o98vPQrF4GpjajQiynzCpdGYgF/UY263/3BLGCMsG /90n/GLBiKn6ybQy6Ed1JufGpKa5dv1gHPzGnuUReh5ErzCelBy4ihTg2RomotxH6SafozXw4 rWE1cjvlqlf7aFWmJKZ+k60OSioOXq9NUIRxTVKWzUKaJ/9KXhH04wtRXrW3ZyGLdpeOrNEVi O3b4A7Rby0gz1pRbCQ9N3Cme0m9UekvNOGKQhxUv7XrYUY432o6rJjV/l74f0H+a3Iky2Kgw1 Unlc5vcXf8ijFyc78SlME4LJeh/lSrSiY1VPw0LZld3VSH+T/12nxSB5fDExovla22ji389G X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238761 Archived-At: "Basil L. Contovounesios" writes: Hi Basil, > Michael Albinus writes: > >> The patch seems to assume that notifications-notify works >> everywhere. That's not the case, since it depends on D-Bus it runs only >> for GNU/Linux systems. > > Thank you for pointing this out. I had wondered about it while > preparing the patch but could not find a description of what happens > when notifications are not supported, other than the usual > "notifications-notify returns an integer ID". > > Does notifications-notify return nil in this case? If so, I would like > to document this. If not, wouldn't this make sense? Likely yes. It uses with-demoted-errors, which should return nil indeed. > What is the best way to determine whether notifications are supported by > the current Emacs instance? I skimmed through (info "(dbus) Top") and > (info "(elisp) Desktop Notifications"), as well as through the syms of > dbusbind.c, dbus.el, and notifications.el, but did not find any clear > answers. (featurep 'dbusbind) checks, whether Emacs is configured to use D-Bus. This does not necessarily tells you that notifications are supported, but it gives you a strong indication for this. You could also wrap the call of notifications-notify by dbus-ignore-errors. A better check would be to ping notifications-service, but this should be done inside notifications.el, if needed. > Currently, gnus-notifications.el checks a) directly whether > notifications-notify is fboundp, and b) indirectly whether > notifications-notify returns nil. Even without notification support, > (a) should always be true after loading the library, right? So the > question is whether (b) is a sufficient condition. > > PS Should gnus-notifications.el be extended to support > w32-notification-notify? > > PPS Would it be possible/welcome to provide a common interface for both > notifications-notify and w32-notification-notify? At the moment it > sounds like programmers need to choose between the two depending on > system-type. In ELPA, there are several notification libraries. alert.el seems to be the most advanced one, although it doesn't support w32-notification-notify. > Thanks, Best regards, Michael.