summary history branches tags files
commit:7872632b3301d146054f780d3e6bd70ede254084
author:Trevor Bentley
committer:Trevor Bentley
date:Thu Dec 3 22:08:05 2020 +0100
parents:c611b50d3463d7b3a8b2dc883aa18f02a942e3c2
fix all hooks: lists weren't passed as symbols
diff --git a/snitch-log.el b/snitch-log.el
line changes: +2/-2
index 8ab8c2d..683f929
--- a/snitch-log.el
+++ b/snitch-log.el
@@ -450,7 +450,7 @@ filter from an existing log line."
   ;; based on which-key
   (when (buffer-live-p buffer)
     (quit-windows-on buffer)
-    (run-hooks snitch-log-filter-window-close-hook)))
+    (run-hooks 'snitch-log-filter-window-close-hook)))
 
 (defun snitch--log-filter-window-size-to-fit (window)
   "Resize log filter window to a reasonable height and maximum
@@ -480,7 +480,7 @@ necessary."
       (display-buffer-reuse-window snitch--log-filter-buffer alist))
      (t
       (display-buffer-in-side-window snitch--log-filter-buffer alist)))
-    (run-hooks snitch-log-filter-window-open-hook)))
+    (run-hooks 'snitch-log-filter-window-open-hook)))
 
 (provide 'snitch-log)
 

diff --git a/snitch.el b/snitch.el
line changes: +9/-10
index db02c53..6b49a04
--- a/snitch.el
+++ b/snitch.el
@@ -553,11 +553,10 @@ block action should be taken."
   (cl-loop for (f-fn . f-args) in decision-list
            ;; when event is in the white/blacklist, and no
            ;; hooks override the list, return t.
-           when (and (apply f-fn (cons event f-args))
-                     (run-hook-with-args-until-failure list-hook-fns
-                                                        'list-evt-type
-                                                        event))
-           return t
+           when (apply f-fn (cons event f-args))
+           return (run-hook-with-args-until-failure list-hook-fns
+                                                    'list-evt-type
+                                                    event)
            ;; otherwise fall back on default policy
            finally return
            (if (run-hook-with-args-until-failure default-hook-fns
@@ -573,7 +572,7 @@ whitelist.  PREFIX is the string 'process' or 'network' to
 indicate the type of event.  Registered hooks are called before
 making the final decision, and the decision is logged based on
 the globally configured log filters."
-  (when (run-hook-with-args-until-failure snitch-on-event-functions
+  (when (run-hook-with-args-until-failure 'snitch-on-event-functions
                                           'event
                                           event)
     (snitch--log 'all event)
@@ -591,16 +590,16 @@ the globally configured log filters."
                             (snitch--decide event
                                             wl
                                             'whitelist
-                                            snitch-on-whitelist-functions
+                                            'snitch-on-whitelist-functions
                                             'block
-                                            snitch-on-block-functions))
+                                            'snitch-on-block-functions))
                            (t ;; policy allow
                             (snitch--decide event
                                             bl
                                             'blacklist
-                                            snitch-on-blacklist-functions
+                                            'snitch-on-blacklist-functions
                                             'allow
-                                            snitch-on-allow-functions)))))
+                                            'snitch-on-allow-functions)))))
       (cond ((eq policy 'deny)
              (progn
                (snitch--log (if decision wled blk) event)