tweaks: rename five empty functions, to get rid of a meaningless suffix

For consistency, these five names ought to start with "flip_", but
then the bindable functions would need to be renamed too, and that
would be annoying for the user, *and* it would create too many names
that start with "flip" -- it wouldn't be distinctive any more.
master
Benno Schulenberg 2021-10-08 10:53:04 +02:00
parent aeae4fb4b9
commit 8ef74b3aac
4 changed files with 30 additions and 30 deletions

View File

@ -2185,17 +2185,17 @@ int do_writeout(bool exiting, bool withprompt)
} else
#endif
#ifndef NANO_TINY
if (func == dos_format_void) {
if (func == dos_format) {
openfile->fmt = (openfile->fmt == DOS_FILE) ? NIX_FILE : DOS_FILE;
continue;
} else if (func == mac_format_void) {
} else if (func == mac_format) {
openfile->fmt = (openfile->fmt == MAC_FILE) ? NIX_FILE : MAC_FILE;
continue;
} else if (func == backup_file_void) {
} else if (func == back_it_up) {
TOGGLE(MAKE_BACKUP);
continue;
} else if (func == prepend_void || func == append_void) {
if (func == prepend_void)
} else if (func == prepend_it || func == append_it) {
if (func == prepend_it)
method = (method == PREPEND) ? OVERWRITE : PREPEND;
else
method = (method == APPEND) ? OVERWRITE : APPEND;

View File

@ -312,19 +312,19 @@ void do_nothing(void)
void do_toggle_void(void)
{
}
void dos_format_void(void)
void dos_format(void)
{
}
void mac_format_void(void)
void mac_format(void)
{
}
void append_void(void)
void append_it(void)
{
}
void prepend_void(void)
void prepend_it(void)
{
}
void backup_file_void(void)
void back_it_up(void)
{
}
void flip_execute(void)
@ -1111,9 +1111,9 @@ void shortcut_init(void)
#endif
#ifndef NANO_TINY
add_to_funcs(dos_format_void, MWRITEFILE,
add_to_funcs(dos_format, MWRITEFILE,
N_("DOS Format"), WITHORSANS(dos_gist), TOGETHER, NOVIEW);
add_to_funcs(mac_format_void, MWRITEFILE,
add_to_funcs(mac_format, MWRITEFILE,
N_("Mac Format"), WITHORSANS(mac_gist), TOGETHER, NOVIEW);
/* If we're using restricted mode, the Append, Prepend, and Backup toggles
@ -1121,12 +1121,12 @@ void shortcut_init(void)
* reduplicating the current file, and the third is not allowed as it
* would write to a file not specified on the command line. */
if (!ISSET(RESTRICTED)) {
add_to_funcs(append_void, MWRITEFILE,
add_to_funcs(append_it, MWRITEFILE,
N_("Append"), WITHORSANS(append_gist), TOGETHER, NOVIEW);
add_to_funcs(prepend_void, MWRITEFILE,
add_to_funcs(prepend_it, MWRITEFILE,
N_("Prepend"), WITHORSANS(prepend_gist), TOGETHER, NOVIEW);
add_to_funcs(backup_file_void, MWRITEFILE,
add_to_funcs(back_it_up, MWRITEFILE,
N_("Backup File"), WITHORSANS(backup_gist), BLANKAFTER, NOVIEW);
}
@ -1461,14 +1461,14 @@ void shortcut_init(void)
if (ISSET(SAVE_ON_EXIT) && !ISSET(PRESERVE))
add_to_sclist(MWRITEFILE, "^Q", 0, discard_buffer, 0);
#ifndef NANO_TINY
add_to_sclist(MWRITEFILE, "M-D", 0, dos_format_void, 0);
add_to_sclist(MWRITEFILE, "M-M", 0, mac_format_void, 0);
add_to_sclist(MWRITEFILE, "M-D", 0, dos_format, 0);
add_to_sclist(MWRITEFILE, "M-M", 0, mac_format, 0);
/* Only when not in restricted mode, allow Appending, Prepending,
* making backups, and executing a command. */
if (!ISSET(RESTRICTED) && !ISSET(VIEW_MODE)) {
add_to_sclist(MWRITEFILE, "M-A", 0, append_void, 0);
add_to_sclist(MWRITEFILE, "M-P", 0, prepend_void, 0);
add_to_sclist(MWRITEFILE, "M-B", 0, backup_file_void, 0);
add_to_sclist(MWRITEFILE, "M-A", 0, append_it, 0);
add_to_sclist(MWRITEFILE, "M-P", 0, prepend_it, 0);
add_to_sclist(MWRITEFILE, "M-B", 0, back_it_up, 0);
add_to_sclist(MINSERTFILE|MEXECUTE, "^X", 0, flip_execute, 0);
}
add_to_sclist(MINSERTFILE, "M-N", 0, flip_convert, 0);

View File

@ -643,11 +643,11 @@ void goto_dir(void);
#ifndef NANO_TINY
void do_nothing(void);
void do_toggle_void(void);
void dos_format_void(void);
void mac_format_void(void);
void append_void(void);
void prepend_void(void);
void backup_file_void(void);
void dos_format(void);
void mac_format(void);
void append_it(void);
void prepend_it(void);
void back_it_up(void);
void flip_execute(void);
void flip_pipe(void);
void flip_convert(void);

View File

@ -415,15 +415,15 @@ keystruct *strtosc(const char *input)
#endif
#ifndef NANO_TINY
else if (!strcmp(input, "dosformat"))
s->func = dos_format_void;
s->func = dos_format;
else if (!strcmp(input, "macformat"))
s->func = mac_format_void;
s->func = mac_format;
else if (!strcmp(input, "append"))
s->func = append_void;
s->func = append_it;
else if (!strcmp(input, "prepend"))
s->func = prepend_void;
s->func = prepend_it;
else if (!strcmp(input, "backup"))
s->func = backup_file_void;
s->func = back_it_up;
else if (!strcmp(input, "flipexecute"))
s->func = flip_execute;
else if (!strcmp(input, "flippipe"))