Back when hooks were in development, the hooks_run() function used to be
called directly from the cmdq.  However, that is no longer the case
since hooks are called via notify callbacks instead.

We can safely remove this function and its definition.
---
 hooks.c | 27 ---------------------------
 tmux.h  |  2 --
 2 files changed, 29 deletions(-)

diff --git a/hooks.c b/hooks.c
index 832e6f84..361f3522 100644
--- a/hooks.c
+++ b/hooks.c
@@ -140,33 +140,6 @@ hooks_find(struct hooks *hooks, const char *name)
 }
 
 void
-hooks_run(struct hooks *hooks, struct client *c, struct cmd_find_state *fs,
-    const char *fmt, ...)
-{
-       struct hook             *hook;
-       va_list                  ap;
-       char                    *name;
-       struct cmdq_item        *new_item;
-
-       va_start(ap, fmt);
-       xvasprintf(&name, fmt, ap);
-       va_end(ap);
-
-       hook = hooks_find(hooks, name);
-       if (hook == NULL) {
-               free(name);
-               return;
-       }
-       log_debug("running hook %s", name);
-
-       new_item = cmdq_get_command(hook->cmdlist, fs, NULL, CMDQ_NOHOOKS);
-       cmdq_format(new_item, "hook", "%s", name);
-       cmdq_append(c, new_item);
-
-       free(name);
-}
-
-void
 hooks_insert(struct hooks *hooks, struct cmdq_item *item,
     struct cmd_find_state *fs, const char *fmt, ...)
 {
diff --git a/tmux.h b/tmux.h
index 30c99e7e..85719c07 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1585,8 +1585,6 @@ void               hooks_add(struct hooks *, const char 
*, struct cmd_list *);
 void            hooks_copy(struct hooks *, struct hooks *);
 void            hooks_remove(struct hooks *, const char *);
 struct hook    *hooks_find(struct hooks *, const char *);
-void printflike(4, 5) hooks_run(struct hooks *, struct client *,
-                   struct cmd_find_state *, const char *, ...);
 void printflike(4, 5) hooks_insert(struct hooks *, struct cmdq_item *,
                    struct cmd_find_state *, const char *, ...);
 
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to