From: Michael Albinus <michael.albinus@gmx.de>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: Julien Danjou <julien@danjou.info>,
Lars Ingebrigtsen <larsi@gnus.org>,
emacs-devel@gnu.org
Subject: Re: Proposed changes to gnus-notifications.el
Date: Sun, 21 Jul 2019 12:40:17 +0200 [thread overview]
Message-ID: <87wogbisby.fsf@gmx.de> (raw)
In-Reply-To: <87wogbraj0.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 21 Jul 2019 10:40:03 +0100")
"Basil L. Contovounesios" <contovob@tcd.ie> writes:
Hi Basil,
> Michael Albinus <michael.albinus@gmx.de> 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.
next prev parent reply other threads:[~2019-07-21 10:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-21 0:52 Proposed changes to gnus-notifications.el Basil L. Contovounesios
2019-07-21 8:01 ` Michael Albinus
2019-07-21 9:40 ` Basil L. Contovounesios
2019-07-21 10:40 ` Michael Albinus [this message]
2019-07-21 15:54 ` Basil L. Contovounesios
2019-07-21 17:16 ` Michael Albinus
2019-07-21 15:55 ` Error handling in notifications-notify (was: Proposed changes to gnus-notifications.el) Basil L. Contovounesios
2019-07-21 17:21 ` Error handling in notifications-notify Michael Albinus
2019-07-21 14:34 ` Proposed changes to gnus-notifications.el Eli Zaretskii
2019-07-21 13:44 ` Lars Ingebrigtsen
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=87wogbisby.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=contovob@tcd.ie \
--cc=emacs-devel@gnu.org \
--cc=julien@danjou.info \
--cc=larsi@gnus.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.