From 4930fbbba726e90bd2f080c0484e726415719397 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 26 May 2024 17:01:53 +0200 Subject: [PATCH] docs: explain the details of --colonparsing / -@ / 'set colonparsing' Also, remove the earlier explanation, when colon parsing was still done by default. --- doc/nano.1 | 13 ++++++++++--- doc/nano.texi | 24 +++++++++++++++++++++--- doc/nanorc.5 | 10 ++++++++++ 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/doc/nano.1 b/doc/nano.1 index 8ca854a5..cc2eab80 100644 --- a/doc/nano.1 +++ b/doc/nano.1 @@ -58,9 +58,6 @@ When giving a filename on the command line, the cursor can be put on a specific line by adding the line number with a plus sign (\fB+\fR) before the filename, and even in a specific column by adding it with a comma. Negative numbers count from the end of the file or line. -The line and column numbers may also be specified by gluing them with colons -after the filename. (When a filename contains a colon followed by digits, -escape the colon by preceding it with a triple backslash.) .sp The cursor can be put on the first or last occurrence of a specific string by specifying that string after \fB+/\fR or \fB+?\fR before the filename. @@ -354,6 +351,16 @@ Make Ctrl+Right and Ctrl+Delete stop at word ends instead of beginnings. When neither the file's name nor its first line give a clue, try using libmagic to determine the applicable syntax. .TP +.BR \-@ ", " \-\-colonparsing +When a filename given on the command line ends in a colon plus digits +and this filename does not exist, then snip the colon plus digits and +understand the digits as a line number. If the trimmed filename does +not exist either, then repeat the process and understand the obtained +two numbers as line and column number. But if the doubly trimmed +filename does not exist either, then forget the trimming and accept +the original filename as is. To disable this colon parsing, use +something like \fB+1\fR before the filename. +.TP .BR \-% ", " \-\-stateflags Use the top-right corner of the screen for showing some state flags: \fBI\fR when auto-indenting, \fBM\fR when the mark is on, \fBL\fR when diff --git a/doc/nano.texi b/doc/nano.texi index 35ad7484..dbdc2ff8 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -156,9 +156,6 @@ The cursor can be put on a specific line of a file by adding the line number with a plus sign before the filename, and even in a specific column by adding it with a comma. Negative numbers count from the end of the file or line. -The line and column numbers may also be specified by gluing them with colons -after the filename. (When a filename contains a colon followed by digits, -escape the colon by preceding it with a triple backslash.) The cursor can be put on the first or last occurrence of a specific string by specifying that string after @code{+/} or @code{+?} before the filename. @@ -720,6 +717,17 @@ instead of beginnings. When neither the file's name nor its first line give a clue, try using libmagic to determine the applicable syntax. +@item -@ +@itemx --colonparsing +When a filename given on the command line ends in a colon plus digits +and this filename does not exist, then snip the colon plus digits and +understand the digits as a line number. If the trimmed filename does +not exist either, then repeat the process and understand the obtained +two numbers as line and column number. But if the doubly trimmed +filename does not exist either, then forget the trimming and accept +the original filename as is. To disable this colon parsing, use +something like @code{+1} before the filename. + @item -% @itemx --stateflags Use the top-right corner of the screen for showing some state flags: @@ -929,6 +937,16 @@ Automatically hard-wrap the current line when it becomes overlong. @item set casesensitive Do case-sensitive searches by default. +@item set colonparsing +When a filename given on the command line ends in a colon plus digits +and this filename does not exist, then snip the colon plus digits and +understand the digits as a line number. If the trimmed filename does +not exist either, then repeat the process and understand the obtained +two numbers as line and column number. But if the doubly trimmed +filename does not exist either, then forget the trimming and accept +the original filename as is. To disable this colon parsing, use +something like @code{+1} before the filename. + @item set constantshow Constantly display the cursor position on the status bar. Note that this overrides @option{quickblank}. diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 672f6e16..5f8a9cd6 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -121,6 +121,16 @@ Automatically hard-wrap the current line when it becomes overlong. .B set casesensitive Do case-sensitive searches by default. .TP +.B set colonparsing +When a filename given on the command line ends in a colon plus digits +and this filename does not exist, then snip the colon plus digits and +understand the digits as a line number. If the trimmed filename does +not exist either, then repeat the process and understand the obtained +two numbers as line and column number. But if the doubly trimmed +filename does not exist either, then forget the trimming and accept +the original filename as is. To disable this colon parsing, use +something like \fB+1\fR before the filename. +.TP .B set constantshow Constantly display the cursor position in the status bar. This overrides the option \fBquickblank\fR.