From ee78f2348bd0c0555d681932698152fc7d6d8def Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 5 Jul 2020 11:02:41 +0200 Subject: [PATCH] rcfile: rename bindable function 'curpos' to 'location' It is better that the bindable function is named the same as the tag in the help lines, and that it is not an ugly abbreviation. --- doc/nano.texi | 6 ++++-- doc/nanorc.5 | 6 ++++-- doc/sample.nanorc.in | 2 +- src/rcfile.c | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/nano.texi b/doc/nano.texi index 6f69f36f..e6513bea 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -1308,8 +1308,10 @@ Cuts all text from the cursor position till the end of the buffer. Sets the mark at the current position, to start selecting text. Or, when it is set, unsets the mark. -@item curpos -Shows the current cursor position: the line, column, and character positions. +@item location +Reports the current position of the cursor in the buffer: +the line, column, and character positions. +(The old name of this function, 'curpos', is deprecated.) @item wordcount Counts the number of words, lines and characters in the current buffer. diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 9b714832..22ae2bc5 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -612,8 +612,10 @@ Cuts all text from the cursor position till the end of the buffer. Sets the mark at the current position, to start selecting text. Or, when it is set, unsets the mark. .TP -.B curpos -Shows the current cursor position: the line, column, and character positions. +.B location +Reports the current position of the cursor in the buffer: +the line, column, and character positions. +(The old name of this function, 'curpos', is deprecated.) .TP .B wordcount Counts the number of words, lines and characters in the current buffer. diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in index 96366cfb..c44e4d7d 100644 --- a/doc/sample.nanorc.in +++ b/doc/sample.nanorc.in @@ -269,7 +269,7 @@ #bind ^X cut all #bind ^C copy main #bind ^V paste all -#bind ^P curpos main +#bind ^P location main #bind ^A mark main #unbind ^K main #unbind ^U all diff --git a/src/rcfile.c b/src/rcfile.c index 6c3f52ec..733db378 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -279,7 +279,8 @@ keystruct *strtosc(const char *input) else if (!strcmp(input, "formatter")) s->func = do_formatter; #endif - else if (!strcmp(input, "curpos")) + else if (!strcmp(input, "location") || + !strcmp(input, "curpos")) /* Deprecated; remove in 2022. */ s->func = report_cursor_position; else if (!strcmp(input, "gotoline")) s->func = do_gotolinecolumn_void;