Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs notifications with notification :off #26

Closed
danielma opened this issue Oct 26, 2016 · 2 comments
Closed

Emacs notifications with notification :off #26

danielma opened this issue Oct 26, 2016 · 2 comments

Comments

@danielma
Copy link

I have an issue where the default emacs notification gets run even with notification(:off) in my ~/.guard.rb.

I'd like to use a custom Emacs script like this one in the wiki but when I allow notifications to be on at all, my mode-line background color changes with every guard run.

Here's my setup.

# ~/.guard.rb

notification(
  :emacs,
  elisp_file: '~/.dotfiles/ruby/notiffany.erb',
  success: 'ok',
  failed: 'error',
  default: 'Black',
  fontcolor: 'White'
)

# ~/.dotfiles/ruby/notiffany.erb

(progn
  (if (string= "<%= bgcolor %>" "ok")
      (setq mode-line-guard-status 'ok)
    (setq mode-line-guard-status 'error))
  (force-mode-line-update))

When I run bundle exec guard -d, I can see that my elisp file is being run, and I'm seeing what I expect, but the default elisp snippet is also run.

If I set notification(:off) in ~/.guard.rb and run bundle exec guard -d I don't see any notification output in the terminal, but the default elisp snippet is run anyways.

The only way I've been able to get the default elisp snippet to stop running is to use guard with --no-notify or to set GUARD_NOTIFY=false in my terminal, which means I can't get any notifications.

Can you help me only get my custom emacs notification, and turn the default one off?

@danielma
Copy link
Author

I've done my best to debug this issue, but I can't wrap my head around what's going on. I've puts debugged as much of notiffany as I can, trying to figure out why it seems like emacs is being notified twice, but I can't seem to find any traces of it

@danielma
Copy link
Author

Turns out, this was actually a problem in guard-minitest. Looks like it was fixed in guard/guard-minitest#141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant