2

I upgraded Org from the built-in 9.1.9 to the maint branch 9.3.3 (directions here). I now get this error when I clock in or out:

Debugger entered--Lisp error: (dbus-error "Emacs not compiled with dbus support")
  signal(dbus-error ("Emacs not compiled with dbus support"))
  dbus-call-method(:session "org.freedesktop.Notifications" "/org/freedesktop/Notifications" "org.freedesktop.Notifications" "Notify" :string "Emacs" :uint32 0 :string "/Applications/Emacs.app/Contents/Resources/etc/images/icons/hicolor/scalable/apps/emacs.svg" :string "Org mode message" :string "Task ‘zero email inbox’ should be finished by now. (0:30)" (:array) ((:dict-entry "urgency" (:variant :byte 0))) :int32 3000)
  notifications-notify(:title "Org mode message" :body "Task ‘zero email inbox’ should be finished by now. (0:30)" :timeout 3000 :urgency low)
  org-show-notification("Task ‘zero email inbox’ should be finished by now. (0:30)")
  org-notify("Task ‘zero email inbox’ should be finished by now. (0:30)" nil)
  org-clock-notify-once-if-expired()
  org-clock-update-mode-line()
  org-clock-in(nil)
  funcall-interactively(org-clock-in nil)
  call-interactively(org-clock-in nil nil)
  command-execute(org-clock-in)

From the depth of the error in the stack trace, I think this is a bug with Org mode or an incompatibility with my system (Emacs 26.3 (9.0) and macOS Mojave 10.14.6). I tried to catch the error with:

(condition-case nil
    (org-clock-in)
  (message "caught error clocking in"))

and I still get the error.

Is this a bug I should report? How can I silence it in the meantime?

miguelmorin
  • 1,907
  • 12
  • 33
  • /me prays for org mode to not turn into a bloatware – Flint Feb 12 '20 at 15:21
  • 1
    You can unbind notifications-notify with (fmakunbound 'notifications-notify): that should stop the errors. For a more permanent fix, you could rebuild your emacs with dbus support: ./configure --with-dbus && make but that assumes you build your emacs from source. It does look like a bug however that notifications is loaded even though the underlying emacs is not built with dbus support. A bug report to the emacs bug list is probably a good idea. – NickD Feb 12 '20 at 16:23
  • @NickD I load the new Org mode with (add-to-list 'load-path "~/code/org-mode/lisp") (require 'org-loaddefs) (fmakunbound 'notifications-notify) and am still getting the same error. notifications-notify is not a variable or a function. How can I verify its value before and after that command? – miguelmorin Feb 16 '20 at 11:25
  • That's not the same error: this indicates that the symbol is not defined, so get rid of the (fmakunbound 'notififications-notify) and try again: it may be that whatever was causing notifications.el to be loaded is no longer doing that. – NickD Feb 16 '20 at 12:49
  • Actually, it probably means that at that point, notifications.el is not loaded yet, but it will probably be loaded later on and you'll have the original problem. If that's the case, then try (eval-after-load 'notifications (fmakunbound 'notifications-notify)) in your init file. That will wait until notifications.el is loaded before trying to unbind the function cell of notifications-notify. But again, this is a band-aid: you'll need to find out how and why notifications is loaded. – NickD Feb 17 '20 at 03:32
  • I still get the same error with (eval-after-load 'notifications (fmakunbound 'notifications-notify)) after loading the new version of org mode. I have fixed it temporarily by removing the property :Effort: 0:30 from the task. – miguelmorin Feb 18 '20 at 20:23
  • I decided to roll back to 9.1.9 after I got yet another error in 9.3.3 that was absent in 9.1.9 ((void-variable org-org-menu) when loading an Org file). Maybe @Flint had a point about bloatware. – miguelmorin Feb 20 '20 at 08:31
  • @Flint does have a point - but it is too late :-) – NickD Mar 19 '21 at 14:53

1 Answers1

2

At least in the more recent version of org-mode (9.4.4), one can fix this issue by modifying the variable org-show-notification-handler, e.g., by adding the following to the init file:

(setq org-show-notification-handler 'message)

org notifications (e.g., alerts related to clocking and effort) are then displayed at the bottom of the screen.