From a0f66c0691940afe688028b64a858de84c61d07e Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 23 Jun 2014 18:30:35 +0000 Subject: [PATCH] Renaming 'no_replace_void()' to 'flip_replace_void()', to show what it actually does. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5014 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ doc/man/nanorc.5 | 4 ++-- doc/texinfo/nano.texi | 4 ++-- src/global.c | 14 +++++++------- src/proto.h | 2 +- src/search.c | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0576beaa..b8222ce4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2014-06-23 Benno Schulenberg * src/nano.h, src/move.c (do_up, do_down), src/winio.c (edit_scrol): Rename UP_DIR and DOWN_DIR to UPWARD and DOWNWARD, for clarity. + * src/proto.h, src/global.c, src/search.c: Rename 'no_replace_void()' + to 'flip_replace_void()', to show what it actually does. + * doc/man/nanorc.5, doc/texinfo/nano.texi: Update the docs for that. 2014-06-22 Benno Schulenberg * src/browser.c (parse_browser_input), src/help.c (parse_help_input): diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5 index ffc36398..5ba4f731 100644 --- a/doc/man/nanorc.5 +++ b/doc/man/nanorc.5 @@ -514,8 +514,8 @@ Shows the previous history entry in the prompt menus (e.g. search). .B nexthistory Shows the next history entry in the prompt menus (e.g. search). .TP -.B dontreplace -Switches back to searching instead of replacing. +.B flipreplace +Toggles between searching for something and replacing something. .TP .B flipexecute Toggles between inserting a file and executing a command. diff --git a/doc/texinfo/nano.texi b/doc/texinfo/nano.texi index 40fc42fc..0ee18746 100644 --- a/doc/texinfo/nano.texi +++ b/doc/texinfo/nano.texi @@ -1040,8 +1040,8 @@ Shows the previous history entry in the prompt menus (e.g. search). @item nexthistory Shows the next history entry in the prompt menus (e.g. search). -@item dontreplace -Switches back to searching instead of replacing. +@item flipreplace +Toggles between searching for something and replacing something. @item flipexecute Toggles between inserting a file and executing a command. diff --git a/src/global.c b/src/global.c index 86151f9e..36a2c63f 100644 --- a/src/global.c +++ b/src/global.c @@ -267,7 +267,7 @@ void backup_file_void(void) void new_buffer_void(void) { } -void no_replace_void(void) +void flip_replace_void(void) { } void flip_execute_void(void) @@ -741,10 +741,10 @@ void shortcut_init(void) N_("Backwards"), IFSCHELP(nano_reverse_msg), FALSE, VIEW); #endif - add_to_funcs(do_replace, MWHEREIS, + add_to_funcs(flip_replace_void, MWHEREIS, replace_tag, IFSCHELP(nano_replace_msg), FALSE, VIEW); - add_to_funcs(no_replace_void, MREPLACE, + add_to_funcs(flip_replace_void, MREPLACE, N_("No Replace"), IFSCHELP(nano_whereis_msg), FALSE, VIEW); #ifndef DISABLE_JUSTIFY @@ -1115,8 +1115,7 @@ void shortcut_init(void) add_to_sclist(MWHEREIS|MREPLACE, "M-C", case_sens_void, 0, FALSE); #endif add_to_sclist(MWHEREIS|MREPLACE, "M-R", regexp_void, 0, FALSE); - add_to_sclist(MWHEREIS, "^R", do_replace, 0, FALSE); - add_to_sclist(MREPLACE, "^R", no_replace_void, 0, FALSE); + add_to_sclist(MWHEREIS|MREPLACE, "^R", flip_replace_void, 0, FALSE); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE, "^Y", do_first_line, 0, TRUE); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE, "^V", do_last_line, 0, TRUE); #ifndef DISABLE_JUSTIFY @@ -1474,8 +1473,9 @@ sc *strtosc(char *input) s->scfunc = backwards_void; s->execute = FALSE; #endif - } else if (!strcasecmp(input, "dontreplace")) { - s->scfunc = no_replace_void; + } else if (!strcasecmp(input, "flipreplace") || + !strcasecmp(input, "dontreplace")) { + s->scfunc = flip_replace_void; s->execute = FALSE; } else if (!strcasecmp(input, "gototext")) { s->scfunc = gototext_void; diff --git a/src/proto.h b/src/proto.h index 44a4dd00..1226188f 100644 --- a/src/proto.h +++ b/src/proto.h @@ -831,7 +831,7 @@ void backup_file_void(void); void new_buffer_void(void); void backwards_void(void); void goto_dir_void(void); -void no_replace_void(void); +void flip_replace_void(void); void flip_execute_void(void); #endif /* !PROTO_H */ diff --git a/src/search.c b/src/search.c index 690be6d9..06d0208e 100644 --- a/src/search.c +++ b/src/search.c @@ -249,7 +249,7 @@ int search_init(bool replacing, bool use_answer) backupstring = mallocstrcpy(backupstring, answer); return 1; #endif - } else if (func == do_replace || func == no_replace_void) { + } else if (func == do_replace || func == flip_replace_void) { backupstring = mallocstrcpy(backupstring, answer); return -2; /* Call the opposite search function. */ } else if (func == do_gotolinecolumn_void) { -- 2.39.5