syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

ERC notifications not working correctly on OS X #2324

Closed gunnarhelgason closed 4 years ago

gunnarhelgason commented 9 years ago

I've enabled the erc layer in .spacemacs and installed the terminal-notifier gem. However, instead of receiving notifications I get the following error in emacs: error in process filter: peculiar error: "Emacs not compiled with dbus support"

If I add (require 'erc-terminal-notifier) to my .spacemacs, the notifications are delivered to the OS X notification center, but the dbus error persists.

The documentation for the erc layer does not specify that you have to do anything special (other than installing terminal-notifier) to get notifications to work on OS X. Is this a bug, or have I misunderstood something? I assume that at least the dbus error is a bug as dbus isn't available on OS X AFAIK.

CestDiego commented 9 years ago

Sorry cannot reproduce ;_; don't have osx. :3 maybe one of the osx users can help.

cmccloud commented 9 years ago

I was having a similar error. I don't make use of notifications in my own erc configuration, but the error seems to be coming from this block of code:

      (defun erc-global-notify (match-type nick message)
        "Notify when a message is recieved."
        (notifications-notify
         :title nick
         :body message
         :app-icon "/home/io/.emacs.d/assets/spacemacs.svg"
         :urgency 'low))

      (add-hook 'erc-text-matched-hook 'erc-global-notify)

notifications-notify requires d-bus. I fixed it by adding the following line to my post-erc configuration:

(remove-hook 'erc-text-matched-hook 'erc-global-notify)

@gunnarhelgason if you try this out and it works for you let me know and I'll look into making a change to the erc package layer to only add that hook if it detects dbus support.

asheshambasta commented 6 years ago

@cmccloud sorry if this is a stale issue and I'm bringing it up again – but I can still reproduce this even with

(remove-hook 'erc-text-matched-hook 'erc-global-notify)

At the end of my init file.

Miciah commented 6 years ago

Are you on macOS? What do you get if you open the eval prompt (M-:) and enter (bound-and-true-p dbus-compiled-version)?

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!