check for dbus before add erc-notify hook.

OSX doesn't have dbus support. 'erc-global-notify makes a call to
notifications which relies on dbus. Check to see if
dbus-compiled-version exists before adding hook.

Note: This variable is added in emacs 24.3. There may be a better way to
check for dbus support.
This commit is contained in:
Christopher McCloud 2015-08-17 16:32:20 -07:00 committed by syl20bnr
parent d17c229c2a
commit 0703d45d94
1 changed files with 4 additions and 1 deletions

View File

@ -73,7 +73,10 @@
:app-icon "/home/io/.emacs.d/assets/spacemacs.svg"
:urgency 'low))
(add-hook 'erc-text-matched-hook 'erc-global-notify)
;; osx doesn't have dbus support
(when (boundp 'dbus-compiled-version)
(add-hook 'erc-text-matched-hook 'erc-global-notify))
;; keybindings
(evil-leader/set-key-for-mode 'erc-mode
"md" 'erc-input-action