From eb84205426f8256f0a2998c2ab655682bec1420f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 1 Jun 2018 12:47:04 +0200 Subject: [PATCH] bindings: rename two bindable functions: copytext to copy, uncut to paste To match the common names used for these functions, for consistency, and because 'uncut' sounds too much like "undo the cut". --- doc/nano.texi | 8 +++++--- doc/nanorc.5 | 8 +++++--- src/global.c | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/doc/nano.texi b/doc/nano.texi index f1258c81..07cf2972 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -1140,12 +1140,14 @@ Interactively replaces text within the current buffer. @item cut Cuts and stores the current line (or the marked region). -@item copytext +@item copy Copies the current line (or the marked region) without deleting it. +(The old form 'copytext' is deprecated.) -@item uncut -Copies the currently stored text into the current buffer at the +@item paste +Pastes the currently stored text into the current buffer at the current cursor position. +(The old form 'uncut' is deprecated.) @item cutwordleft Cuts from the cursor position to the beginning of the preceding word. diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 77df44d7..484f8c4f 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -487,12 +487,14 @@ Interactively replaces text within the current buffer. .B cut Cuts and stores the current line (or the marked region). .TP -.B copytext +.B copy Copies the current line (or the marked region) without deleting it. +(The old form 'copytext' is deprecated.) .TP -.B uncut -Copies the currently stored text into the current buffer at the +.B paste +Pastes the currently stored text into the current buffer at the current cursor position. +(The old form 'uncut' is deprecated.) .TP .B cutwordleft Cuts from the cursor position to the beginning of the preceding word. diff --git a/src/global.c b/src/global.c index 89cb580b..089d530f 100644 --- a/src/global.c +++ b/src/global.c @@ -1498,12 +1498,14 @@ sc *strtosc(const char *input) s->func = do_replace; else if (!strcasecmp(input, "cut")) s->func = do_cut_text_void; - else if (!strcasecmp(input, "uncut")) + else if (!strcasecmp(input, "paste") || + !strcasecmp(input, "uncut")) /* Deprecated. Remove end of 2018. */ s->func = do_uncut_text; #ifndef NANO_TINY else if (!strcasecmp(input, "cutrestoffile")) s->func = do_cut_till_eof; - else if (!strcasecmp(input, "copytext")) + else if (!strcasecmp(input, "copy") || + !strcasecmp(input, "copytext")) /* Deprecated. Remove end of 2018. */ s->func = do_copy_text; else if (!strcasecmp(input, "mark")) s->func = do_mark;