summary history branches tags files
commit:02e0308024bba88541e773e8adeab5f0475820d0
author:Trevor Bentley
committer:Trevor Bentley
date:Thu Dec 3 01:25:38 2020 +0100
parents:21fc6e629999c7a55f38e902f35633293b995a54
documentation was missing the hook type argument
diff --git a/README.md b/README.md
line changes: +12/-2
index d2d3bd2..1b6895d
--- a/README.md
+++ b/README.md
@@ -192,6 +192,9 @@ arguments from the cdr of the rules entry:
 
   (defun filter-fn1 (event &rest args))
 
+EVENT is an eieio object defined by ‘snitch-network-entry’ or
+‘snitch-process-entry’, and inheriting from ‘snitch-source’.
+
 A trivial function which matches if a single string in the event
 object matches a known value might look like so:
 
@@ -229,9 +232,16 @@ These hooks can subscribe to receive events either immediately on
 arrival, upon a final decision, or both.  The hooks can change
 snitch’s final decision.
 
-Hook functions take a single argument, the event object:
+Hook functions take two arguments, the type and the event object:
+
+  (defun snitch-hook (type event))
+
+TYPE is one of `snitch-hook-types', and corresponds with the names
+of the hook lists.  This argument is provided so you can define one
+function which can be used in several hooks.
 
-  (defun snitch-hook (event))
+EVENT is an eieio object defined by ‘snitch-network-entry’ or
+‘snitch-process-entry’, and inheriting from ‘snitch-source’.
 
 Hooks should return t to allow snitch to continue processing as it
 would have, or return nil to reverse snitch’s decision.  For hooks

diff --git a/snitch.el b/snitch.el
line changes: +12/-2
index 40723f6..db02c53
--- a/snitch.el
+++ b/snitch.el
@@ -208,6 +208,9 @@
 ;;
 ;;   (defun filter-fn1 (event &rest args))
 ;;
+;; EVENT is an eieio object defined by ‘snitch-network-entry’ or
+;; ‘snitch-process-entry’, and inheriting from ‘snitch-source’.
+;;
 ;; A trivial function which matches if a single string in the event
 ;; object matches a known value might look like so:
 ;;
@@ -245,9 +248,16 @@
 ;; arrival, upon a final decision, or both.  The hooks can change
 ;; snitch’s final decision.
 ;;
-;; Hook functions take a single argument, the event object:
+;; Hook functions take two arguments, the type and the event object:
+;;
+;;   (defun snitch-hook (type event))
+;;
+;; TYPE is one of `snitch-hook-types', and corresponds with the names
+;; of the hook lists.  This argument is provided so you can define one
+;; function which can be used in several hooks.
 ;;
-;;   (defun snitch-hook (event))
+;; EVENT is an eieio object defined by ‘snitch-network-entry’ or
+;; ‘snitch-process-entry’, and inheriting from ‘snitch-source’.
 ;;
 ;; Hooks should return t to allow snitch to continue processing as it
 ;; would have, or return nil to reverse snitch’s decision.  For hooks