summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-02-21 18:41:45 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-02-21 18:41:45 +0000
commit7103fc87b804624379a4dff884d671a73c1af47c (patch)
treeb0205628a2830902ff5ed5c362f8b41136f73f43 /src/fe-common/core
parent4a35a41c85d6fea8668553d135f7947f26313254 (diff)
downloadirssi-7103fc87b804624379a4dff884d671a73c1af47c.zip
/FOREACH server|channel|query|window <command>
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1276 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r--src/fe-common/core/window-commands.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c
index e2e43039..049d74e1 100644
--- a/src/fe-common/core/window-commands.c
+++ b/src/fe-common/core/window-commands.c
@@ -454,6 +454,23 @@ static void cmd_savewindows(void)
windows_save();
}
+/* SYNTAX: FOREACH WINDOW <command> */
+static void cmd_foreach_window(const char *data)
+{
+ WINDOW_REC *old;
+ GSList *tmp;
+
+ old = active_win;
+ for (tmp = windows; tmp != NULL; tmp = tmp->next) {
+ WINDOW_REC *rec = tmp->data;
+
+ active_win = rec;
+ signal_emit("send command", 3, data, rec->active_server,
+ rec->active);
+ }
+ active_win = old;
+}
+
void window_commands_init(void)
{
command_bind("window", NULL, (SIGNAL_FUNC) cmd_window);
@@ -480,6 +497,7 @@ void window_commands_init(void)
command_bind("window list", NULL, (SIGNAL_FUNC) cmd_window_list);
command_bind("window theme", NULL, (SIGNAL_FUNC) cmd_window_theme);
command_bind("savewindows", NULL, (SIGNAL_FUNC) cmd_savewindows);
+ command_bind("foreach window", NULL, (SIGNAL_FUNC) cmd_foreach_window);
command_set_options("window number", "sticky");
command_set_options("window server", "sticky unsticky");
@@ -511,4 +529,5 @@ void window_commands_deinit(void)
command_unbind("window list", (SIGNAL_FUNC) cmd_window_list);
command_unbind("window theme", (SIGNAL_FUNC) cmd_window_theme);
command_unbind("savewindows", (SIGNAL_FUNC) cmd_savewindows);
+ command_unbind("foreach window", (SIGNAL_FUNC) cmd_foreach_window);
}