rcfile: stop accepting 'set view' in a nanorc file, and undocument it

Like --restricted, --view really only makes sense on the command line.
master
Benno Schulenberg 2020-10-10 12:40:38 +02:00
parent e1601d2eb5
commit 26f5c8b9d5
5 changed files with 1 additions and 15 deletions

View File

@ -1067,11 +1067,6 @@ Save a file by default in Unix format. This overrides nano's
default behavior of saving a file in the format that it had. default behavior of saving a file in the format that it had.
(This option has no effect when you also use @code{set noconvert}.) (This option has no effect when you also use @code{set noconvert}.)
@item set view
Disallow file modification: read-only mode.
This mode allows the user to open also other files for viewing,
unless @option{--restricted} is given on the command line.
@anchor{Whitespace} @anchor{Whitespace}
@item set whitespace "@var{characters}" @item set whitespace "@var{characters}"
Set the two characters used to indicate the presence of tabs and Set the two characters used to indicate the presence of tabs and

View File

@ -352,11 +352,6 @@ Save a file by default in Unix format. This overrides nano's
default behavior of saving a file in the format that it had. default behavior of saving a file in the format that it had.
(This option has no effect when you also use \fBset noconvert\fR.) (This option has no effect when you also use \fBset noconvert\fR.)
.TP .TP
.B set view
Disallow file modification: read-only mode.
This mode allows the user to open also other files for viewing,
unless \fB\-\-restricted\fR is given on the command line.
.TP
.BI "set whitespace """ characters """ .BI "set whitespace """ characters """
Set the two characters used to indicate the presence of tabs and Set the two characters used to indicate the presence of tabs and
spaces. They must be single-column characters. The default pair spaces. They must be single-column characters. The default pair

View File

@ -179,9 +179,6 @@
## Snip whitespace at the end of lines when justifying or hard-wrapping. ## Snip whitespace at the end of lines when justifying or hard-wrapping.
# set trimblanks # set trimblanks
## Disallow file modification. Why would you want this in an rcfile? ;)
# set view
## The two single-column characters used to display the first characters ## The two single-column characters used to display the first characters
## of tabs and spaces. 187 in ISO 8859-1 (0000BB in Unicode) and 183 in ## of tabs and spaces. 187 in ISO 8859-1 (0000BB in Unicode) and 183 in
## ISO-8859-1 (0000B7 in Unicode) seem to be good values for these. ## ISO-8859-1 (0000B7 in Unicode) seem to be good values for these.

View File

@ -95,7 +95,6 @@ static const rcoption rcopts[] = {
{"suspend", SUSPENDABLE}, /* Deprecated; remove in 2022. */ {"suspend", SUSPENDABLE}, /* Deprecated; remove in 2022. */
{"suspendable", SUSPENDABLE}, {"suspendable", SUSPENDABLE},
{"tempfile", SAVE_ON_EXIT}, /* Deprecated; remove in 2022. */ {"tempfile", SAVE_ON_EXIT}, /* Deprecated; remove in 2022. */
{"view", VIEW_MODE},
#ifndef NANO_TINY #ifndef NANO_TINY
{"afterends", AFTER_ENDS}, {"afterends", AFTER_ENDS},
{"allow_insecure_backup", INSECURE_BACKUP}, {"allow_insecure_backup", INSECURE_BACKUP},

View File

@ -7,7 +7,7 @@ comment "#"
color brightred ".*" color brightred ".*"
# Keywords # Keywords
color brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|stateflags|suspendable|tabstospaces|trimblanks|unix|view|wordbounds|zap)\>" color brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|breaklonglines|casesensitive|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling|linenumbers|locking|magic|mouse|multibuffer|noconvert|nohelp|nonewlines|positionlog|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap|stateflags|suspendable|tabstospaces|trimblanks|unix|wordbounds|zap)\>"
color yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|scroller|selected|status|stripe|title)color)[[:space:]]+(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>" color yellow "^[[:space:]]*set[[:space:]]+((error|function|key|number|scroller|selected|status|stripe|title)color)[[:space:]]+(bold,)?(italic,)?(bright|light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte)?(,(light)?(white|black|red|blue|green|yellow|magenta|cyan|normal|pink|purple|mauve|lagoon|mint|lime|peach|orange|latte))?\>"
color brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|scrollercolor|selectedcolor|speller|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:space:]]+" color brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|errorcolor|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|scrollercolor|selectedcolor|speller|statuscolor|stripecolor|titlecolor|whitespace|wordchars)[[:space:]]+"
color brightgreen "^[[:space:]]*set[[:space:]]+(fill[[:space:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:space:]]+[1-9][0-9]*)\>" color brightgreen "^[[:space:]]*set[[:space:]]+(fill[[:space:]]+-?[[:digit:]]+|(guidestripe|tabsize)[[:space:]]+[1-9][0-9]*)\>"