mirror of
https://github.com/dimitri/el-get.git
synced 2024-09-29 04:58:53 +08:00
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.
This commit is contained in:
parent
cc6a66360c
commit
36538d10b7
|
@ -55,6 +55,7 @@ fallback."
|
||||||
"Notify the user using either the dbus based API or the `growl' one"
|
"Notify the user using either the dbus based API or the `growl' one"
|
||||||
(when (not (eq el-get-notify-type 'message))
|
(when (not (eq el-get-notify-type 'message))
|
||||||
(unless (and (fboundp 'dbus-register-signal)
|
(unless (and (fboundp 'dbus-register-signal)
|
||||||
|
(boundp 'dbus-compiled-version)
|
||||||
;; avoid a bug in Emacs 24.0 under darwin
|
;; avoid a bug in Emacs 24.0 under darwin
|
||||||
(ignore-errors (require 'notifications nil t)))
|
(ignore-errors (require 'notifications nil t)))
|
||||||
;; else try notify.el, there's a recipe for it
|
;; else try notify.el, there's a recipe for it
|
||||||
|
@ -67,7 +68,8 @@ fallback."
|
||||||
;; Message only
|
;; Message only
|
||||||
((equal el-get-notify-type 'message) (error "Use `message' instead"))
|
((equal el-get-notify-type 'message) (error "Use `message' instead"))
|
||||||
;; Graphical notification
|
;; Graphical notification
|
||||||
((fboundp 'notifications-notify) (notifications-notify :title title
|
((and (fboundp 'notifications-notify) (boundp 'dbus-compiled-version))
|
||||||
|
(notifications-notify :title title
|
||||||
:app-name "el-get"
|
:app-name "el-get"
|
||||||
:app-icon (concat
|
:app-icon (concat
|
||||||
(el-get-package-directory "el-get")
|
(el-get-package-directory "el-get")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user