diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-05 03:00:44 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-24 10:22:55 +0100 |
commit | 977bfad903c35f1e33fc978289404226ac0693e9 (patch) | |
tree | 4612f825fc0c24947fe2390470648ea42f1deca9 | |
parent | 77176d78b15a702d47725738df01eace86ebfa07 (diff) | |
download | ratpoison-977bfad903c35f1e33fc978289404226ac0693e9.zip |
Kill code and simplify cmd_number
* cmd_number needs at least one argument
* The code that handled the zero argument case was thus unreachable,
and was the last user of print_window_information, so kill that
function.
-rw-r--r-- | src/actions.c | 15 | ||||
-rw-r--r-- | src/window.c | 15 | ||||
-rw-r--r-- | src/window.h | 1 |
3 files changed, 4 insertions, 27 deletions
diff --git a/src/actions.c b/src/actions.c index fa35ae9..887322e 100644 --- a/src/actions.c +++ b/src/actions.c @@ -2768,13 +2768,6 @@ cmd_number (int interactive UNUSED, struct cmdarg **args) int old_number, new_number; rp_window_elem *other_win, *win; - if (args[0] == NULL) - { - /* XXX: Fix this. */ - print_window_information (rp_current_group, current_window()); - return cmdret_new (RET_SUCCESS, NULL); - } - /* Gather the args. */ new_number = ARG(0,number); if (args[1]) @@ -4485,9 +4478,9 @@ cmd_restart (int interactive UNUSED, struct cmdarg **args UNUSED) } cmdret * -cmd_startup_message (int interactive, struct cmdarg **args) +cmd_startup_message (int interactive UNUSED, struct cmdarg **args) { - if (args[0] == NULL && !interactive) + if (args[0] == NULL) return cmdret_new (RET_SUCCESS, "%s", defaults.startup_message ? "on":"off"); if (!strcasecmp (ARG_STRING(0), "on")) @@ -4648,9 +4641,9 @@ cmd_sselect(int interactive UNUSED, struct cmdarg **args) } cmdret * -cmd_warp (int interactive, struct cmdarg **args) +cmd_warp (int interactive UNUSED, struct cmdarg **args) { - if (args[0] == NULL && !interactive) + if (args[0] == NULL) return cmdret_new (RET_SUCCESS, "%s", defaults.warp ? "on":"off"); if (!strcasecmp (ARG_STRING(0), "on")) diff --git a/src/window.c b/src/window.c index 1caf8e9..de9032a 100644 --- a/src/window.c +++ b/src/window.c @@ -594,21 +594,6 @@ goto_window (rp_window *win) } } -void -print_window_information (rp_group *group, rp_window *win) -{ - rp_window_elem *win_elem; - /* Display the window's number in group. This gives the possibility - of windows existing in multiple groups. */ - win_elem = group_find_window (&group->mapped_windows, win); - if (win_elem) - marked_message_printf (0, 0, MESSAGE_WINDOW_INFORMATION, - win_elem->number, window_name (win)); - else - marked_message_printf (0, 0, "%s doesn't exist in group %d\n", - window_name(win), group->number); -} - /* get the window list and store it in buffer delimiting each window with delim. mark_start and mark_end will be filled with the text positions for the start and end of the current window. */ diff --git a/src/window.h b/src/window.h index 0b81e6f..d32b2e0 100644 --- a/src/window.h +++ b/src/window.h @@ -57,7 +57,6 @@ void sort_window_list_by_number (void); void insert_into_list (rp_window *win, struct list_head *list); -void print_window_information (rp_group *group, rp_window *win); void get_window_list (char *fmt, char *delim, struct sbuf *buffer, int *mark_start, int *mark_end); void init_window_stuff (void); |