emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Schumacher <tim@datenknoten.me>
To: emacs-orgmode@gnu.org
Subject: Re: org-show-notification of org-clock.el broken on MS Windows
Date: Sun, 26 Jan 2020 12:19:44 +0100	[thread overview]
Message-ID: <85ftg2mpm7.wl-tim@datenknoten.me> (raw)
In-Reply-To: <87eevmk553.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

Hi Bastien,

On Sun, 26 Jan 2020 10:12:40 +0100,
Bastien wrote:

> > * The function org-show-notification should be more robust. It should not fail
> >   if it can't fire a notification for whatever reason.
>
> Please send a patch if needed for this.

I tried my best, check the attachedd patch.

> > * On MS Windows the function w32-notification-notify should be used.
>
> I just fixed this one:
> https://code.orgmode.org/bzg/org-mode/commit/8dd2984a

This actualy does not work, because the notification will be closed instantly
and it will never appear.

I'm currently in the process of writing a patch[1] to change that. The problem
is, that emacs give the notification a static id and if there is a notification
from your application with the same id windows wont spawn another notification,
because you can update the notification. My plan is, to genrate a GUID and use
that as its id, so that you can have multiple notifications and don't have to
close the notification. But this does not work yet, since my C skills are not as
good as it used to be.

Thanks for your work!

Tim


[1]
https://github.com/emacs-mirror/emacs/compare/master...enko:feature/notification-guid


[-- Attachment #2: 0001-org-clock.el-Check-if-dbus-is-available-for-notifica.patch --]
[-- Type: application/octet-stream, Size: 873 bytes --]

From dfcec69c7f9f89cbb34ed3f07cd5362961d80c53 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <tim@datenknoten.me>
Date: Sun, 26 Jan 2020 12:14:26 +0100
Subject: [PATCH] org-clock.el: Check if dbus is available for
 notifications-notify

---
 lisp/org-clock.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 7fb97f021..157d55509 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -813,7 +813,7 @@ use libnotify if available, or fall back on a message."
 	((stringp org-show-notification-handler)
 	 (start-process "emacs-timer-notification" nil
 			org-show-notification-handler notification))
-	((fboundp 'notifications-notify)
+	((and (fboundp 'dbus-compiled-version) (fboundp 'notifications-notify))
 	 (notifications-notify
 	  :title "Org mode message"
 	  :body notification
-- 
2.24.0.windows.1


  reply	other threads:[~2020-01-26 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24  9:08 org-show-notification of org-clock.el broken on MS Windows Tim Schumacher
2020-01-26  8:12 ` Bastien
2020-01-26 11:19   ` Tim Schumacher [this message]
2020-01-26 16:37     ` Bastien

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=85ftg2mpm7.wl-tim@datenknoten.me \
    --to=tim@datenknoten.me \
    --cc=emacs-orgmode@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).