commit ee78f2348bd0c0555d681932698152fc7d6d8def
parent 2261377309099e95dd63273482eb652012bfa79f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 5 Jul 2020 11:02:41 +0200
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.
Diffstat:
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git 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
@@ -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
@@ -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
@@ -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;