From 59ad37223522bb0168b10a85cc891ecb59c30f4c Mon Sep 17 00:00:00 2001 From: sabetts Date: Sat, 23 Aug 2003 06:48:24 +0000 Subject: * src/split.c (remove_all_splits): only hide the windows in the current screen. * src/group.h (group_delete_group): new prototype * src/group.c (group_last_window): find the last window in the current screen. (group_next_window): find next window in current screen. (group_prev_window): find previous window in current screen. * src/manage.c (force_maximize): call XSync() after first resize. * src/globals.h (GROUP_DELETE_GROUP_OK): new define (GROUP_DELETE_GROUP_NONEMPTY): likewise * src/actions.h (cmd_gdelete): new prototype * src/actions.c (user_commands): new command gdelete (cmd_gdelete): new command --- src/actions.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index 9b70e47..700ffd1 100644 --- a/src/actions.c +++ b/src/actions.c @@ -102,7 +102,8 @@ static user_command user_commands[] = {"gprev", cmd_gprev, arg_VOID}, {"gnew", cmd_gnew, arg_VOID}, {"gnewbg", cmd_gnewbg, arg_VOID}, - {"gselect", cmd_gselect, arg_VOID}, + {"gselect", cmd_gselect, arg_STRING}, + {"gdelete", cmd_gdelete, arg_STRING}, {"groups", cmd_groups, arg_VOID}, {"gmove", cmd_gmove, arg_VOID}, {"gmerge", cmd_gmerge, arg_VOID}, @@ -3817,7 +3818,36 @@ cmd_listhook (int interactive, char *data) free(buffer); return tmp; } +} + +char * +cmd_gdelete (int interactive, char *data) +{ + rp_group *g; + if (data == NULL) + g = rp_current_group; + else + { + g = find_group (data); + if (!g) + { + message (" gdelete: cannot find group "); + return NULL; + } + } + + switch (group_delete_group (g)) + { + case GROUP_DELETE_GROUP_OK: + break; + case GROUP_DELETE_GROUP_NONEMPTY: + message (" gdelete: non-empty group "); + break; + default: + message (" gdelete: Unknown return code (this shouldn't happen) "); + } + return NULL; } -- cgit v1.2.3