*Enotify: a networked notification system for emacs* 

Enotify provides some sort of system tray for emacs.

It is born as a vehicle for TDD notifications, as the writer does not like annoying popups floating around his tiled workspace.

An application can connect to enotify and send a notification message, that will discreetly appear in the emacs mode-line.

== INSTALLATION ==

Get the code from [https://github.com/laynor/enotify the github repository], add the enotify directory to your emacs load-path and require enotify:

{{{
(add-to-list 'load-path "path/to/enotify")
(require 'enotify)
(enotify-minor-mode t)
}}}

or grab it from [Lisp:enotify.el here] as a single file. 

== USAGE ==
Enotify uses the TCP port 5000 by default. You can customize `enotify-port' if you want.

Messages are sent as strings and have this format:

{{{
    |<message size>|<message body>
}}}

Message bodies have the form of a keyword argument list, like 

{{{
	(:register "MySlotID")
}}}

The message size is intended as the length in characters of the message body. In the last example, this would be
{{{
        |22|(:register "MySlotID")
}}}

=== Enotify slots ===

An application that wants to send notifications should register a *slot*
- the equivalent of an icon in a system tray - before sending any notification message.

The message used to register a slot

{{{
	(:register <slot-name> :handler-fn <message-data-processing-funcion>)
}}}

The function passed as :handler-fn is of the form

{{{
	(handler-fn slot-id data)
}}}

whose purpose of the :handler-fn parameter will be clarified in the following section.

=== Notifications ===

The message used to send a notification has the form 

{{{
	(:id <slot-name>
	 :notification (:text <slot text>
	                :face <slot face>
			:help <tooltip text>
			:mouse-1 <mouse-1 handler>)
	 :data <additional-data>)
}}}

; /data/: it will be passed to the handler function specified in the slot registration message
; /text/: the text to be displayed in the notification area
; /face/: the face used to display the text in the notification area
; /help/: tooltip text on mouse-over
; /mouse-1/: an (iteractive "e") handler function of the form 

  	       ----
			(m1-handler event)            
	       ----

	       It's possible to retrieve the slot id with

	       ----
			(enotify-event->slot-id event)
	       ----

== Ruby/Rails/Rspec/Watchr TDD application ==
As of now, [https://github.com/laynor/espectator laynor/espectator] this is the only application for enotify.
If you are interested, you can look at the code and see how does it work.

It's best used together with [https://github.com/laynor/rspec_org_formatter Rspec Org Formatter], that provides
org-mode formatted text for rspec results.
