From bde996db67e044352f4e279f0e5c80d5097510f3 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 11 Nov 2015 19:56:35 +0000 Subject: [PATCH] Discarding a now useless function. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5403 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/browser.c | 6 +++--- src/global.c | 8 ++++---- src/prompt.c | 10 +++++----- src/proto.h | 1 - src/text.c | 6 ------ src/winio.c | 2 +- 7 files changed, 14 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1bd21b3a..63a5eecf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ will behave differently depending on the setting of autoindent. This addresses Debian bug #793053 reported by Clancy. * src/text.c (do_enter): Chop the now unused parameter 'undoing'. + * src/text.c (do_enter_void): Discard this now useless function. 2015-11-10 Benno Schulenberg * src/winio.c (edit_draw): Skip a zero-length match only when there diff --git a/src/browser.c b/src/browser.c index d5325f84..eb6119ac 100644 --- a/src/browser.c +++ b/src/browser.c @@ -158,7 +158,7 @@ char *do_browser(char *path, DIR *dir) /* If we selected the same filename as last time, * put back the Enter key so that it's read in. */ if (old_selected == selected) - unget_kbinput(sc_seq_or(do_enter_void, 0), FALSE, FALSE); + unget_kbinput(sc_seq_or(do_enter, 0), FALSE, FALSE); } } #endif /* !DISABLE_MOUSE */ @@ -285,7 +285,7 @@ char *do_browser(char *path, DIR *dir) } else if (func == do_right) { if (selected < filelist_len - 1) selected++; - } else if (func == do_enter_void) { + } else if (func == do_enter) { /* We can't move up from "/". */ if (strcmp(filelist[selected], "/..") == 0) { statusbar(_("Can't move up a directory")); @@ -538,7 +538,7 @@ functionptrtype parse_browser_input(int *kbinput) return goto_dir_void; case 'S': case 's': - return do_enter_void; + return do_enter; case 'W': case 'w': return do_search; diff --git a/src/global.c b/src/global.c index 15dbbbfb..73a93bba 100644 --- a/src/global.c +++ b/src/global.c @@ -888,7 +888,7 @@ void shortcut_init(void) add_to_funcs(do_tab, MMAIN, N_("Tab"), IFSCHELP(nano_tab_msg), TOGETHER, NOVIEW); - add_to_funcs(do_enter_void, MMAIN, + add_to_funcs(do_enter, MMAIN, N_("Enter"), IFSCHELP(nano_enter_msg), BLANKAFTER, NOVIEW); add_to_funcs(do_delete, MMAIN, @@ -1217,8 +1217,8 @@ void shortcut_init(void) add_to_sclist(MHELP, "End", do_last_line, 0); #endif add_to_sclist(MMOST, "^I", do_tab, 0); - add_to_sclist(MMOST, "^M", do_enter_void, 0); - add_to_sclist(MMOST, "Enter", do_enter_void, 0); + add_to_sclist(MMOST, "^M", do_enter, 0); + add_to_sclist(MMOST, "Enter", do_enter, 0); add_to_sclist(MMOST, "^D", do_delete, 0); add_to_sclist(MMOST, "Del", do_delete, 0); add_to_sclist(MMOST, "^H", do_backspace, 0); @@ -1448,7 +1448,7 @@ sc *strtosc(char *input) else if (!strcasecmp(input, "tab")) s->scfunc = do_tab; else if (!strcasecmp(input, "enter")) - s->scfunc = do_enter_void; + s->scfunc = do_enter; else if (!strcasecmp(input, "delete")) s->scfunc = do_delete; else if (!strcasecmp(input, "backspace")) diff --git a/src/prompt.c b/src/prompt.c index 2cd5b7ab..448ff7f6 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -145,7 +145,7 @@ int do_statusbar_input(bool *ran_func, bool *finished, } if (have_shortcut) { - if (s->scfunc == do_tab || s->scfunc == do_enter_void) + if (s->scfunc == do_tab || s->scfunc == do_enter) ; else if (s->scfunc == total_refresh) total_statusbar_refresh(refresh_func); @@ -186,7 +186,7 @@ int do_statusbar_input(bool *ran_func, bool *finished, * set finished to TRUE to indicate that we're done. */ if (got_enter) { get_input(NULL, 1); - input = sc_seq_or(do_enter_void, 0); + input = sc_seq_or(do_enter, 0); *finished = TRUE; } } @@ -809,7 +809,7 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs, func = func_from_key(&kbinput); - if (func == do_cancel || func == do_enter_void) + if (func == do_cancel || func == do_enter) break; #ifndef DISABLE_TABCOMP @@ -927,7 +927,7 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs, * we've finished putting in an answer, reset the statusbar cursor * position too. */ if (func) { - if (func == do_cancel || func == do_enter_void || ran_func) { + if (func == do_cancel || func == do_enter || ran_func) { statusbar_x = old_statusbar_x; statusbar_pww = old_pww; @@ -1010,7 +1010,7 @@ int do_prompt(bool allow_tabs, * properly. */ if (func == do_cancel) retval = -1; - else if (func == do_enter_void) + else if (func == do_enter) retval = (*answer == '\0') ? -2 : 0; blank_statusbar(); diff --git a/src/proto.h b/src/proto.h index 1fee0e9a..e5b855e1 100644 --- a/src/proto.h +++ b/src/proto.h @@ -659,7 +659,6 @@ void do_undo(void); void do_redo(void); #endif void do_enter(void); -void do_enter_void(void); #ifndef NANO_TINY RETSIGTYPE cancel_command(int signal); bool execute_command(const char *command); diff --git a/src/text.c b/src/text.c index 00b554a2..1f554ded 100644 --- a/src/text.c +++ b/src/text.c @@ -815,12 +815,6 @@ void do_enter() edit_refresh_needed = TRUE; } -/* Need this again... */ -void do_enter_void(void) -{ - do_enter(); -} - #ifndef NANO_TINY /* Send a SIGKILL (unconditional kill) to the forked process in * execute_command(). */ diff --git a/src/winio.c b/src/winio.c index 6b8e5271..799be5d2 100644 --- a/src/winio.c +++ b/src/winio.c @@ -565,7 +565,7 @@ int parse_kbinput(WINDOW *win) retval = sc_seq_or(do_page_up, *kbinput); break; case KEY_ENTER: - retval = sc_seq_or(do_enter_void, *kbinput); + retval = sc_seq_or(do_enter, *kbinput); break; case KEY_B2: /* Center (5) on numeric keypad with * NumLock off. */ -- 2.39.5