Skip to content

Instantly share code, notes, and snippets.

@lamdor
Created July 26, 2010 16:08
Show Gist options
  • Select an option

  • Save lamdor/490757 to your computer and use it in GitHub Desktop.

Select an option

Save lamdor/490757 to your computer and use it in GitHub Desktop.
require 'autotest/fsevent'
require 'autotest/growl'
module Autotest::Emacs
@@client_cmd = 'emacsclient -e'
def self.command= o
@@client_cmd = o
end
def self.emacs_autotest status
`#{@@client_cmd} \"(autotest-update '#{status})\"`
end
def self.register_hooks
Autotest.add_hook :run_command do |at|
emacs_autotest :running
end
Autotest.add_hook :green do |at|
emacs_autotest :passed
end
Autotest.add_hook :all_good do |at|
emacs_autotest :passed
end
Autotest.add_hook :red do |at|
emacs_autotest :failed
end
Autotest.add_hook :quit do |at|
emacs_autotest :quit
end
end
end
Autotest::Emacs.register_hooks if ENV['INSIDE_EMACS']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment