Merge branch 'master' into rexy712

This commit is contained in:
rexy712 2023-06-03 19:18:19 -07:00
commit 4fefb91028
8 changed files with 46 additions and 40 deletions

View File

@ -19,7 +19,7 @@
.TH NANO 1 "version 7.2" "January 2023" .TH NANO 1 "version 7.2" "January 2023"
.SH NAME .SH NAME
nano \- Nano's ANOther editor, inspired by Pico nano \- Nano's ANOther text editor, inspired by Pico
.SH SYNOPSIS .SH SYNOPSIS
.B nano .B nano
@ -28,10 +28,10 @@ nano \- Nano's ANOther editor, inspired by Pico
.B nano .B nano
.RI [ options "] [" file [\fB: line [\fB: column "]]]..." .RI [ options "] [" file [\fB: line [\fB: column "]]]..."
.sp .sp
.BR nano " [" \fIoptions "] [[" + [ crCR ]( / | ? ) \fIstring "] " \fIfile ]... .BR nano " [" \fIoptions "] [[" + [ crCR ]{ / | ? } \fIstring "] " \fIfile ]...
.SH DESCRIPTION .SH DESCRIPTION
\fBnano\fP is a small and friendly editor. It copies the look and feel \fBnano\fP is a small and friendly text editor. It copies the look and feel
of Pico, but is free software, and implements several features that Pico of Pico, but is free software, and implements several features that Pico
lacks, such as: opening multiple files, scrolling per line, undo/redo, lacks, such as: opening multiple files, scrolling per line, undo/redo,
syntax coloring, line numbering, and soft-wrapping overlong lines. syntax coloring, line numbering, and soft-wrapping overlong lines.

View File

@ -35,7 +35,7 @@ The complete manual for the GNU nano text editor.
@page @page
This manual documents the GNU @command{nano} editor. This manual documents the GNU @command{nano} text editor.
@sp 1 @sp 1
The contents of this manual are part of the GNU @command{nano} distribution. The contents of this manual are part of the GNU @command{nano} distribution.
@ -163,7 +163,7 @@ A more complete command synopsis thus is:
@blankline @blankline
@example @example
@code{nano [OPTION]@dots{} [[+LINE[,COLUMN]|+[crCR](/|?)STRING] FILE]@dots{}} @code{nano [OPTION]@dots{} [[+LINE[,COLUMN]|+[crCR]@{/|?@}STRING] FILE]@dots{}}
@end example @end example
@blankline @blankline

View File

@ -23,7 +23,7 @@ nanorc \- GNU nano's configuration file
.SH DESCRIPTION .SH DESCRIPTION
The \fInanorc\fP files contain the default settings for \fBnano\fP, The \fInanorc\fP files contain the default settings for \fBnano\fP,
a small and friendly editor. During startup, if \fB\-\-rcfile\fR a small and friendly text editor. During startup, if \fB\-\-rcfile\fR
is not given, \fBnano\fR will read two files: first the is not given, \fBnano\fR will read two files: first the
system-wide settings, from \fI/etc/nanorc\fP (the exact path might be system-wide settings, from \fI/etc/nanorc\fP (the exact path might be
different on your system), and then the user-specific settings, either different on your system), and then the user-specific settings, either

View File

@ -32,15 +32,19 @@ access to the filesystem nor to a command shell.
.sp .sp
In restricted mode, \fBnano\fR will: In restricted mode, \fBnano\fR will:
.IP \[bu] 2 .IP \[bu] 2
not make backups;
.IP \[bu]
not allow suspending; not allow suspending;
.IP \[bu] .IP \[bu]
not allow spell checking;
.IP \[bu]
not read nor write the history files;
.IP \[bu]
not allow saving the current buffer under a different name; not allow saving the current buffer under a different name;
.IP \[bu] .IP \[bu]
not allow inserting another file or opening a new buffer; not allow inserting another file or opening a new buffer;
.IP \[bu] .IP \[bu]
not allow appending or prepending to any file; not allow appending or prepending to any file.
.IP \[bu]
not make backup files nor do spell checking.
.SH OPTIONS .SH OPTIONS
.TP .TP

View File

@ -219,7 +219,7 @@
* needs execution or a specified function name is invalid. */ * needs execution or a specified function name is invalid. */
#define MORE_PLANTS 0x4EA #define MORE_PLANTS 0x4EA
#define MISSING_BRACE 0x4EB #define MISSING_BRACE 0x4EB
#define PLANTED_COMMAND 0x4EC #define PLANTED_A_COMMAND 0x4EC
#define NO_SUCH_FUNCTION 0x4EF #define NO_SUCH_FUNCTION 0x4EF
/* A special keycode for when <Tab> is pressed while the mark is on. */ /* A special keycode for when <Tab> is pressed while the mark is on. */

View File

@ -535,7 +535,8 @@ void mention_name_and_linecount(void)
if (ISSET(MINIBAR)) { if (ISSET(MINIBAR)) {
report_size = TRUE; report_size = TRUE;
return; return;
} } else if (ISSET(ZERO))
return;
if (openfile->fmt > NIX_FILE) if (openfile->fmt > NIX_FILE)
/* TRANSLATORS: First %s is file name, second %s is file format. */ /* TRANSLATORS: First %s is file name, second %s is file format. */

View File

@ -266,9 +266,12 @@ char *startup_problem = NULL;
#endif #endif
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
char *custom_nanorc = NULL; char *custom_nanorc = NULL;
/* The argument of the --rcfile option, when given. */
char *commandname = NULL; char *commandname = NULL;
/* The name (of a function) between braces in a string bind. */
keystruct *planted_shortcut = NULL; keystruct *planted_shortcut = NULL;
/* The function that the above name resolves to, if any. */
#endif #endif
bool spotlighted = FALSE; bool spotlighted = FALSE;
@ -464,7 +467,7 @@ const keystruct *get_shortcut(const int keycode)
return NULL; return NULL;
#endif #endif
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
if (keycode == PLANTED_COMMAND) if (keycode == PLANTED_A_COMMAND)
return planted_shortcut; return planted_shortcut;
#endif #endif
@ -981,7 +984,10 @@ void shortcut_init(void)
add_to_funcs(do_verbatim_input, MMAIN, add_to_funcs(do_verbatim_input, MMAIN,
N_("Verbatim"), WHENHELP(verbatim_gist), BLANKAFTER); N_("Verbatim"), WHENHELP(verbatim_gist), BLANKAFTER);
#ifndef NANO_TINY #ifdef NANO_TINY
add_to_funcs(do_search_backward, MMAIN,
N_("Where Was"), WHENHELP(wherewas_gist), BLANKAFTER);
#else
add_to_funcs(do_indent, MMAIN, add_to_funcs(do_indent, MMAIN,
N_("Indent"), WHENHELP(indent_gist), TOGETHER); N_("Indent"), WHENHELP(indent_gist), TOGETHER);
add_to_funcs(do_unindent, MMAIN, add_to_funcs(do_unindent, MMAIN,
@ -1020,29 +1026,27 @@ void shortcut_init(void)
add_to_funcs(to_next_anchor, MMAIN, add_to_funcs(to_next_anchor, MMAIN,
N_("Down to anchor"), WHENHELP(nextanchor_gist), BLANKAFTER); N_("Down to anchor"), WHENHELP(nextanchor_gist), BLANKAFTER);
if (!ISSET(RESTRICTED)) {
#ifdef ENABLE_SPELLER #ifdef ENABLE_SPELLER
add_to_funcs(do_spell, MMAIN, add_to_funcs(do_spell, MMAIN,
N_("Spell Check"), WHENHELP(spell_gist), TOGETHER); N_("Spell Check"), WHENHELP(spell_gist), TOGETHER);
#endif #endif
#ifdef ENABLE_LINTER #ifdef ENABLE_LINTER
add_to_funcs(do_linter, MMAIN, add_to_funcs(do_linter, MMAIN,
N_("Linter"), WHENHELP(lint_gist), TOGETHER); N_("Linter"), WHENHELP(lint_gist), TOGETHER);
#endif #endif
#ifdef ENABLE_FORMATTER #ifdef ENABLE_FORMATTER
add_to_funcs(do_formatter, MMAIN, add_to_funcs(do_formatter, MMAIN,
N_("Formatter"), WHENHELP(formatter_gist), BLANKAFTER); N_("Formatter"), WHENHELP(formatter_gist), BLANKAFTER);
#endif #endif
} /* Although not allowed in restricted mode, keep execution rebindable. */
#endif /* !NANO_TINY */ if (ISSET(RESTRICTED))
add_to_funcs(do_execute, MMAIN,
N_("Execute"), WHENHELP(execute_gist), TOGETHER);
#ifdef NANO_TINY
add_to_funcs(do_search_backward, MMAIN,
N_("Where Was"), WHENHELP(wherewas_gist), BLANKAFTER);
#else
add_to_funcs(do_suspend, MMAIN, add_to_funcs(do_suspend, MMAIN,
N_("Suspend"), WHENHELP(suspend_gist), TOGETHER); N_("Suspend"), WHENHELP(suspend_gist), TOGETHER);
#endif #endif /* !NANO_TINY */
#ifdef ENABLE_HELP #ifdef ENABLE_HELP
add_to_funcs(full_refresh, MMAIN, add_to_funcs(full_refresh, MMAIN,
N_("Refresh"), WHENHELP(refresh_gist), TOGETHER); N_("Refresh"), WHENHELP(refresh_gist), TOGETHER);
@ -1113,16 +1117,15 @@ void shortcut_init(void)
N_("No Conversion"), WHENHELP(convert_gist), BLANKAFTER); N_("No Conversion"), WHENHELP(convert_gist), BLANKAFTER);
/* Command execution is only available when not in restricted mode. */ /* Command execution is only available when not in restricted mode. */
if (!ISSET(RESTRICTED) && !ISSET(VIEW_MODE)) { if (!ISSET(RESTRICTED) && !ISSET(VIEW_MODE))
add_to_funcs(flip_execute, MINSERTFILE, add_to_funcs(flip_execute, MINSERTFILE,
N_("Execute Command"), WHENHELP(execute_gist), BLANKAFTER); N_("Execute Command"), WHENHELP(execute_gist), BLANKAFTER);
add_to_funcs(cut_till_eof, MEXECUTE, add_to_funcs(cut_till_eof, MEXECUTE,
N_("Cut Till End"), WHENHELP(cuttilleof_gist), BLANKAFTER); N_("Cut Till End"), WHENHELP(cuttilleof_gist), BLANKAFTER);
add_to_funcs(do_suspend, MEXECUTE, add_to_funcs(do_suspend, MEXECUTE,
N_("Suspend"), WHENHELP(suspend_gist), BLANKAFTER); N_("Suspend"), WHENHELP(suspend_gist), BLANKAFTER);
}
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
#ifdef ENABLE_BROWSER #ifdef ENABLE_BROWSER
@ -1475,24 +1478,22 @@ void shortcut_init(void)
#endif #endif
} }
#endif #endif
add_to_sclist(MBROWSER|MHELP, "^C", 0, do_exit, 0);
#ifdef ENABLE_BROWSER #ifdef ENABLE_BROWSER
/* Only when not in restricted mode, allow entering the file browser. */ /* Only when not in restricted mode, allow entering the file browser. */
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
add_to_sclist(MWRITEFILE|MINSERTFILE, "^T", 0, to_files, 0); add_to_sclist(MWRITEFILE|MINSERTFILE, "^T", 0, to_files, 0);
#endif /* Allow exiting the file browser with the same key as used for entry. */
add_to_sclist(MBROWSER|MHELP, "^C", 0, do_exit, 0);
/* Allow exiting from the file browser and the help viewer with
* the same key as they were entered. */
#ifdef ENABLE_BROWSER
add_to_sclist(MBROWSER, "^T", 0, do_exit, 0); add_to_sclist(MBROWSER, "^T", 0, do_exit, 0);
#endif #endif
#ifdef ENABLE_HELP #ifdef ENABLE_HELP
/* Allow exiting the help viewer with the same keys as used for entry. */
add_to_sclist(MHELP, "^G", 0, do_exit, 0); add_to_sclist(MHELP, "^G", 0, do_exit, 0);
add_to_sclist(MHELP, "F1", KEY_F(1), do_exit, 0); add_to_sclist(MHELP, "F1", KEY_F(1), do_exit, 0);
add_to_sclist(MHELP, "Home", KEY_HOME, to_first_line, 0); add_to_sclist(MHELP, "Home", KEY_HOME, to_first_line, 0);
add_to_sclist(MHELP, "End", KEY_END, to_last_line, 0); add_to_sclist(MHELP, "End", KEY_END, to_last_line, 0);
#endif #endif
#ifdef ENABLE_COLOR #ifdef ENABLE_LINTER
add_to_sclist(MLINTER, "^X", 0, do_cancel, 0); add_to_sclist(MLINTER, "^X", 0, do_cancel, 0);
#endif #endif
add_to_sclist(MMOST & ~MFINDINHELP, "F1", KEY_F(1), do_help, 0); add_to_sclist(MMOST & ~MFINDINHELP, "F1", KEY_F(1), do_help, 0);

View File

@ -429,7 +429,7 @@ int get_code_from_plantation(void)
if (*plants_pointer != '\0') if (*plants_pointer != '\0')
put_back(MORE_PLANTS); put_back(MORE_PLANTS);
return PLANTED_COMMAND; return PLANTED_A_COMMAND;
} else { } else {
char *opening = strchr(plants_pointer, '{'); char *opening = strchr(plants_pointer, '{');
char firstbyte = *plants_pointer; char firstbyte = *plants_pointer;