tweaks: rename two functions, to get rid of one more senseless suffix

master
Benno Schulenberg 2021-11-08 16:54:18 +01:00
parent d3c7e9d2f6
commit 27f170815f
4 changed files with 11 additions and 11 deletions

View File

@ -1110,7 +1110,7 @@ bool execute_command(const char *command)
/* Insert a file into the current buffer (or into a new buffer). But when /* Insert a file into the current buffer (or into a new buffer). But when
* execute is TRUE, run a command in the shell and insert its output into * execute is TRUE, run a command in the shell and insert its output into
* the buffer, or just run one of the tools listed in the help lines. */ * the buffer, or just run one of the tools listed in the help lines. */
void do_insertfile(bool execute) void insert_a_file_or(bool execute)
{ {
int response; int response;
const char *msg; const char *msg;
@ -1301,10 +1301,10 @@ void do_insertfile(bool execute)
} }
/* If the current mode of operation allows it, go insert a file. */ /* If the current mode of operation allows it, go insert a file. */
void do_insertfile_void(void) void do_insertfile(void)
{ {
if (!in_restricted_mode()) if (!in_restricted_mode())
do_insertfile(FALSE); insert_a_file_or(FALSE);
} }
#ifndef NANO_TINY #ifndef NANO_TINY
@ -1312,7 +1312,7 @@ void do_insertfile_void(void)
void do_execute(void) void do_execute(void)
{ {
if (!in_restricted_mode()) if (!in_restricted_mode())
do_insertfile(TRUE); insert_a_file_or(TRUE);
} }
#endif #endif

View File

@ -728,7 +728,7 @@ void shortcut_init(void)
* otherwise, show Insert anyway, to keep the help items paired. */ * otherwise, show Insert anyway, to keep the help items paired. */
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
#endif #endif
add_to_funcs(do_insertfile_void, MMAIN, add_to_funcs(do_insertfile, MMAIN,
N_("Read File"), WITHORSANS(readfile_gist), BLANKAFTER, N_("Read File"), WITHORSANS(readfile_gist), BLANKAFTER,
/* We allow inserting files in view mode if multibuffer mode /* We allow inserting files in view mode if multibuffer mode
* is available, so that the user can view multiple files. */ * is available, so that the user can view multiple files. */
@ -1172,8 +1172,8 @@ void shortcut_init(void)
if (!ISSET(PRESERVE)) if (!ISSET(PRESERVE))
add_to_sclist(MMAIN, "^S", 0, do_savefile, 0); add_to_sclist(MMAIN, "^S", 0, do_savefile, 0);
add_to_sclist(MMAIN, "^O", 0, do_writeout, 0); add_to_sclist(MMAIN, "^O", 0, do_writeout, 0);
add_to_sclist(MMAIN, "^R", 0, do_insertfile_void, 0); add_to_sclist(MMAIN, "^R", 0, do_insertfile, 0);
add_to_sclist(MMAIN, "Ins", KEY_IC, do_insertfile_void, 0); add_to_sclist(MMAIN, "Ins", KEY_IC, do_insertfile, 0);
if (!ISSET(PRESERVE)) if (!ISSET(PRESERVE))
add_to_sclist(MMAIN|MBROWSER|MHELP, "^Q", 0, do_search_backward, 0); add_to_sclist(MMAIN|MBROWSER|MHELP, "^Q", 0, do_search_backward, 0);
add_to_sclist(MMAIN|MBROWSER|MHELP, "^W", 0, do_search_forward, 0); add_to_sclist(MMAIN|MBROWSER|MHELP, "^W", 0, do_search_forward, 0);
@ -1472,7 +1472,7 @@ void shortcut_init(void)
#ifdef ENABLE_JUSTIFY #ifdef ENABLE_JUSTIFY
add_to_sclist(MMAIN, "F4", KEY_F(4), do_justify, 0); add_to_sclist(MMAIN, "F4", KEY_F(4), do_justify, 0);
#endif #endif
add_to_sclist(MMAIN, "F5", KEY_F(5), do_insertfile_void, 0); add_to_sclist(MMAIN, "F5", KEY_F(5), do_insertfile, 0);
add_to_sclist(MMAIN|MBROWSER|MHELP, "F6", KEY_F(6), do_search_forward, 0); add_to_sclist(MMAIN|MBROWSER|MHELP, "F6", KEY_F(6), do_search_forward, 0);
add_to_sclist(MMAIN|MBROWSER|MHELP|MLINTER, "F7", KEY_F(7), do_page_up, 0); add_to_sclist(MMAIN|MBROWSER|MHELP|MLINTER, "F7", KEY_F(7), do_page_up, 0);
add_to_sclist(MMAIN|MBROWSER|MHELP|MLINTER, "F8", KEY_F(8), do_page_down, 0); add_to_sclist(MMAIN|MBROWSER|MHELP|MLINTER, "F8", KEY_F(8), do_page_down, 0);
@ -1485,7 +1485,7 @@ void shortcut_init(void)
#if defined(KEY_CANCEL) && defined(KEY_SUSPEND) && defined(KEY_SIC) #if defined(KEY_CANCEL) && defined(KEY_SUSPEND) && defined(KEY_SIC)
add_to_sclist((MMOST & ~MMAIN) | MYESNO, "", KEY_CANCEL, do_cancel, 0); add_to_sclist((MMOST & ~MMAIN) | MYESNO, "", KEY_CANCEL, do_cancel, 0);
add_to_sclist(MMAIN|MEXECUTE, "", KEY_SUSPEND, suspend_nano, 0); add_to_sclist(MMAIN|MEXECUTE, "", KEY_SUSPEND, suspend_nano, 0);
add_to_sclist(MMAIN, "", KEY_SIC, do_insertfile_void, 0); add_to_sclist(MMAIN, "", KEY_SIC, do_insertfile, 0);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
/* Catch and ignore bracketed paste marker keys. */ /* Catch and ignore bracketed paste marker keys. */

View File

@ -282,7 +282,7 @@ void close_buffer(void);
void read_file(FILE *f, int fd, const char *filename, bool undoable); void read_file(FILE *f, int fd, const char *filename, bool undoable);
int open_file(const char *filename, bool new_one, FILE **f); int open_file(const char *filename, bool new_one, FILE **f);
char *get_next_filename(const char *name, const char *suffix); char *get_next_filename(const char *name, const char *suffix);
void do_insertfile_void(void); void do_insertfile(void);
#ifndef NANO_TINY #ifndef NANO_TINY
void do_execute(void); void do_execute(void);
#endif #endif

View File

@ -246,7 +246,7 @@ keystruct *strtosc(const char *input)
else if (!strcmp(input, "savefile")) else if (!strcmp(input, "savefile"))
s->func = do_savefile; s->func = do_savefile;
else if (!strcmp(input, "insert")) else if (!strcmp(input, "insert"))
s->func = do_insertfile_void; s->func = do_insertfile;
else if (!strcmp(input, "whereis")) else if (!strcmp(input, "whereis"))
s->func = do_search_forward; s->func = do_search_forward;
else if (!strcmp(input, "wherewas")) else if (!strcmp(input, "wherewas"))