nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 02efc760bf574889d080b664455d47f90a7562ea
parent a91bc04e041135ba62d97bdb5b8a23a8140cc5b8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 13 Mar 2020 16:17:10 +0100

tweaks: rename a symbol, to match the corresponding renamed option

Diffstat:
Msrc/global.c | 4++--
Msrc/nano.c | 12++++++------
Msrc/nano.h | 2+-
Msrc/rcfile.c | 6+++---
4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/global.c b/src/global.c @@ -1335,7 +1335,7 @@ void shortcut_init(void) #ifdef ENABLE_MOUSE add_to_sclist(MMAIN, "M-M", 0, do_toggle_void, USE_MOUSE); #endif - add_to_sclist(MMAIN, "M-Z", 0, do_toggle_void, SUSPEND); + add_to_sclist(MMAIN, "M-Z", 0, do_toggle_void, SUSPENDABLE); #endif /* !NANO_TINY */ add_to_sclist(((MMOST & ~MMAIN) | MYESNO), "^C", 0, do_cancel, 0); @@ -1475,7 +1475,7 @@ const char *flagtostr(int flag) return N_("Conversion of typed tabs to spaces"); case USE_MOUSE: return N_("Mouse support"); - case SUSPEND: + case SUSPENDABLE: return N_("Suspension"); case LINE_NUMBERS: return N_("Line numbering"); diff --git a/src/nano.c b/src/nano.c @@ -979,7 +979,7 @@ void signal_init(void) sigaction(SIGWINCH, &deed, NULL); #endif - if (ISSET(SUSPEND)) { + if (ISSET(SUSPENDABLE)) { /* Block all other signals in the suspend and continue handlers. * If we don't do this, other stuff interrupts them! */ sigfillset(&deed.sa_mask); @@ -1052,7 +1052,7 @@ RETSIGTYPE do_suspend(int signal) /* Put nano to sleep (if suspension is enabled). */ void do_suspend_void(void) { - if (ISSET(SUSPEND)) + if (ISSET(SUSPENDABLE)) do_suspend(0); else { statusbar(_("Suspension is not enabled")); @@ -1151,7 +1151,7 @@ void do_toggle(int flag) { bool enabled; - if (flag == SUSPEND && in_restricted_mode()) + if (flag == SUSPENDABLE && in_restricted_mode()) return; TOGGLE(flag); @@ -1167,7 +1167,7 @@ void do_toggle(int flag) mouse_init(); break; #endif - case SUSPEND: + case SUSPENDABLE: signal_init(); break; case SOFTWRAP: @@ -2112,7 +2112,7 @@ int main(int argc, char **argv) break; #endif case 'z': - SET(SUSPEND); + SET(SUSPENDABLE); break; #ifndef NANO_TINY case '$': @@ -2239,7 +2239,7 @@ int main(int argc, char **argv) * since they allow writing to files not specified on the command line. */ if (ISSET(RESTRICTED)) { UNSET(BACKUP_FILE); - UNSET(SUSPEND); + UNSET(SUSPENDABLE); #ifdef ENABLE_NANORC UNSET(HISTORYLOG); UNSET(POSITIONLOG); diff --git a/src/nano.h b/src/nano.h @@ -493,7 +493,7 @@ enum CASE_SENSITIVE, CONSTANT_SHOW, NO_HELP, - SUSPEND, + SUSPENDABLE, NO_WRAP, AUTOINDENT, VIEW_MODE, diff --git a/src/rcfile.c b/src/rcfile.c @@ -89,8 +89,8 @@ static const rcoption rcopts[] = { #ifdef ENABLE_SPELLER {"speller", 0}, #endif - {"suspend", SUSPEND}, /* Deprecated; remove in 2022. */ - {"suspendable", SUSPEND}, + {"suspend", SUSPENDABLE}, /* Deprecated; remove in 2022. */ + {"suspendable", SUSPENDABLE}, {"tabsize", 0}, {"tempfile", TEMP_FILE}, {"view", VIEW_MODE}, @@ -467,7 +467,7 @@ keystruct *strtosc(const char *input) s->toggle = USE_MOUSE; #endif else if (!strcmp(input, "suspendenable")) - s->toggle = SUSPEND; + s->toggle = SUSPENDABLE; else #endif /* !NANO_TINY */ {