From 36538d10b7270ee1ef9e1a1fe34e6eeffba5d769 Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Sun, 22 Sep 2024 11:18:18 +0200 Subject: [PATCH] Fix call to `notifications-notify` on Mac OS where dbus isn't available On EmacsForMacosx the `notifications-notify` is bound, but fails because it isn't compiled with dbus support. This PR adds check for corresponding variables and don't fail. --- el-get-notify.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/el-get-notify.el b/el-get-notify.el index 84ab1fb46..60eb8de10 100644 --- a/el-get-notify.el +++ b/el-get-notify.el @@ -55,6 +55,7 @@ fallback." "Notify the user using either the dbus based API or the `growl' one" (when (not (eq el-get-notify-type 'message)) (unless (and (fboundp 'dbus-register-signal) + (boundp 'dbus-compiled-version) ;; avoid a bug in Emacs 24.0 under darwin (ignore-errors (require 'notifications nil t))) ;; else try notify.el, there's a recipe for it @@ -67,12 +68,13 @@ fallback." ;; Message only ((equal el-get-notify-type 'message) (error "Use `message' instead")) ;; Graphical notification - ((fboundp 'notifications-notify) (notifications-notify :title title - :app-name "el-get" - :app-icon (concat - (el-get-package-directory "el-get") - "/logo/el-get.png") - :body message)) + ((and (fboundp 'notifications-notify) (boundp 'dbus-compiled-version)) + (notifications-notify :title title + :app-name "el-get" + :app-icon (concat + (el-get-package-directory "el-get") + "/logo/el-get.png") + :body message)) ((fboundp 'notify) (notify title message)) ((fboundp 'el-get-growl) (el-get-growl title message)) ;; Fallback