tweaks: rename three functions, to better fit the general scheme

master
Benno Schulenberg 2021-11-09 10:39:31 +01:00
parent 69b2467a9a
commit e4a247f7c9
4 changed files with 15 additions and 15 deletions

View File

@ -982,7 +982,7 @@ void shortcut_init(void)
N_("Refresh"), WITHORSANS(refresh_gist), TOGETHER, VIEW); N_("Refresh"), WITHORSANS(refresh_gist), TOGETHER, VIEW);
#endif #endif
add_to_funcs(suspend_nano, MMAIN, add_to_funcs(do_suspend, MMAIN,
N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW); N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW);
#ifndef NANO_TINY #ifndef NANO_TINY
@ -1106,7 +1106,7 @@ void shortcut_init(void)
add_to_funcs(cut_till_eof, MEXECUTE, add_to_funcs(cut_till_eof, MEXECUTE,
N_("Cut Till End"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW); N_("Cut Till End"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
add_to_funcs(suspend_nano, MEXECUTE, add_to_funcs(do_suspend, MEXECUTE,
N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW); N_("Suspend"), WITHORSANS(suspend_gist), BLANKAFTER, VIEW);
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
@ -1335,7 +1335,7 @@ void shortcut_init(void)
#ifndef NANO_TINY #ifndef NANO_TINY
add_to_sclist(MMAIN, "M-T", 0, cut_till_eof, 0); add_to_sclist(MMAIN, "M-T", 0, cut_till_eof, 0);
add_to_sclist(MEXECUTE, "^V", 0, cut_till_eof, 0); add_to_sclist(MEXECUTE, "^V", 0, cut_till_eof, 0);
add_to_sclist(MEXECUTE, "^Z", 0, suspend_nano, 0); add_to_sclist(MEXECUTE, "^Z", 0, do_suspend, 0);
add_to_sclist(MMAIN, "^Z", 0, suggest_ctrlT_ctrlZ, 0); add_to_sclist(MMAIN, "^Z", 0, suggest_ctrlT_ctrlZ, 0);
add_to_sclist(MMAIN, "M-D", 0, count_lines_words_and_characters, 0); add_to_sclist(MMAIN, "M-D", 0, count_lines_words_and_characters, 0);
#else #else
@ -1484,7 +1484,7 @@ void shortcut_init(void)
#endif #endif
#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, do_suspend, 0);
add_to_sclist(MMAIN, "", KEY_SIC, do_insertfile, 0); add_to_sclist(MMAIN, "", KEY_SIC, do_insertfile, 0);
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY

View File

@ -218,7 +218,7 @@ void suggest_ctrlT_ctrlZ(void)
{ {
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
if (first_sc_for(MMAIN, do_execute) && first_sc_for(MMAIN, do_execute)->keycode == 0x14 && if (first_sc_for(MMAIN, do_execute) && first_sc_for(MMAIN, do_execute)->keycode == 0x14 &&
first_sc_for(MEXECUTE, suspend_nano) && first_sc_for(MEXECUTE, suspend_nano)->keycode == 0x1A) first_sc_for(MEXECUTE, do_suspend) && first_sc_for(MEXECUTE, do_suspend)->keycode == 0x1A)
#endif #endif
statusline(AHEM, _("To suspend, type ^T^Z")); statusline(AHEM, _("To suspend, type ^T^Z"));
} }
@ -902,11 +902,11 @@ void signal_init(void)
* If we don't do this, other stuff interrupts them! */ * If we don't do this, other stuff interrupts them! */
sigfillset(&deed.sa_mask); sigfillset(&deed.sa_mask);
#ifdef SIGTSTP #ifdef SIGTSTP
deed.sa_handler = do_suspend; deed.sa_handler = suspend_nano;
sigaction(SIGTSTP, &deed, NULL); sigaction(SIGTSTP, &deed, NULL);
#endif #endif
#ifdef SIGCONT #ifdef SIGCONT
deed.sa_handler = do_continue; deed.sa_handler = continue_nano;
sigaction(SIGCONT, &deed, NULL); sigaction(SIGCONT, &deed, NULL);
#endif #endif
@ -938,7 +938,7 @@ void handle_crash(int signal)
#endif #endif
/* Handler for SIGTSTP (suspend). */ /* Handler for SIGTSTP (suspend). */
void do_suspend(int signal) void suspend_nano(int signal)
{ {
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
disable_mouse_support(); disable_mouse_support();
@ -961,18 +961,18 @@ void do_suspend(int signal)
} }
/* When permitted, put nano to sleep. */ /* When permitted, put nano to sleep. */
void suspend_nano(void) void do_suspend(void)
{ {
if (in_restricted_mode()) if (in_restricted_mode())
return; return;
do_suspend(0); suspend_nano(0);
ran_a_tool = TRUE; ran_a_tool = TRUE;
} }
/* Handler for SIGCONT (continue after suspend). */ /* Handler for SIGCONT (continue after suspend). */
void do_continue(int signal) void continue_nano(int signal)
{ {
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
if (ISSET(USE_MOUSE)) if (ISSET(USE_MOUSE))

View File

@ -403,9 +403,9 @@ void handle_hupterm(int signal);
#ifndef DEBUG #ifndef DEBUG
void handle_crash(int signal); void handle_crash(int signal);
#endif #endif
void do_suspend(int signal); void suspend_nano(int signal);
void suspend_nano(void); void do_suspend(void);
void do_continue(int signal); void continue_nano(int signal);
#if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined(ENABLE_COLOR) #if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined(ENABLE_COLOR)
void block_sigwinch(bool blockit); void block_sigwinch(bool blockit);
#endif #endif

View File

@ -396,7 +396,7 @@ keystruct *strtosc(const char *input)
else if (!strcmp(input, "refresh")) else if (!strcmp(input, "refresh"))
s->func = full_refresh; s->func = full_refresh;
else if (!strcmp(input, "suspend")) else if (!strcmp(input, "suspend"))
s->func = suspend_nano; s->func = do_suspend;
else if (!strcmp(input, "casesens")) else if (!strcmp(input, "casesens"))
s->func = case_sens_void; s->func = case_sens_void;
else if (!strcmp(input, "regexp")) else if (!strcmp(input, "regexp"))