diff --git a/doc/nano.texi b/doc/nano.texi index 6159bd33f5150a37c27e13f8b4aa6dfe94ea00a9..d66e65a7415b398dd5e08a102c193dabbe041cc4 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -743,6 +743,10 @@ Don't convert files from DOS/Mac format. @item set nohelp Don't display the help lists at the bottom of the screen. +@item set nopauses +Don't pause between warnings at startup. This means that only +the last one will be visible (when there are multiple ones). + @item set nonewlines Don't add newlines to the ends of files. diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 1dd50ca8d347f1ef751b39acf1bb55774cf0f732..ece4e1909abf0e7a45f557fe4335b927685a3286 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -151,6 +151,10 @@ Don't display the two help lines at the bottom of the screen. .B set nonewlines Don't automatically add a newline to the ends of files. .TP +.B set nopauses +Don't pause between warnings at startup. This means that only +the last one will be visible (when there are multiple ones). +.TP .B set nowrap Don't hard-wrap text at all. .TP diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in index c8970b4bade5bdd2f05e20694ffcc3d780c79cdf..b2e9fe725427360f6209e2b0ff97d597e87bccb9 100644 --- a/doc/sample.nanorc.in +++ b/doc/sample.nanorc.in @@ -95,6 +95,10 @@ ## Don't display the helpful shortcut lists at the bottom of the screen. # set nohelp +## Don't pause between warnings at startup. Which means that only the +## last one will be readable (when there are multiple ones). +# set nopauses + ## Don't add newlines to the ends of files. # set nonewlines diff --git a/src/nano.h b/src/nano.h index eba20ace86df382952554e7b6727991195810358..60fc8c6b96d42f2e8182b26cda00f217630fb229 100644 --- a/src/nano.h +++ b/src/nano.h @@ -509,7 +509,8 @@ enum MAKE_IT_UNIX, JUSTIFY_TRIM, SHOW_CURSOR, - LINE_NUMBERS + LINE_NUMBERS, + NO_PAUSES }; /* Flags for the menus in which a given function should be present. */ diff --git a/src/rcfile.c b/src/rcfile.c index 5c0c9439bd14b030572a55ca565ad1e70bbb3dfd..3ede61f642f124dc6fb124acffef4807df62f87b 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -62,6 +62,7 @@ static const rcoption rcopts[] = { #endif {"nohelp", NO_HELP}, {"nonewlines", NO_NEWLINES}, + {"nopauses", NO_PAUSES}, #ifndef DISABLE_WRAPPING {"nowrap", NO_WRAP}, #endif @@ -1292,7 +1293,7 @@ void do_rcfiles(void) free(nanorc); - if (errors && !ISSET(QUIET)) { + if (errors && !ISSET(QUIET) && !ISSET(NO_PAUSES)) { errors = FALSE; fprintf(stderr, _("\nPress Enter to continue starting nano.\n")); while (getchar() != '\n') diff --git a/src/winio.c b/src/winio.c index 1e6cc298a31a08fbf85857238ee30ccb9b5fc0c5..8f99fa8eb1d7449ce47e6e6b01d8fdd84a73c902 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2111,11 +2111,11 @@ void statusline(message_type importance, const char *msg, ...) /* Shortly pause after each of the first three alert messages, * to give the user time to read them. */ - if (lastmessage == ALERT && alerts < 4) + if (lastmessage == ALERT && alerts < 4 && !ISSET(NO_PAUSES)) napms(1200); if (importance == ALERT) { - if (++alerts > 3) + if (++alerts > 3 && !ISSET(NO_PAUSES)) msg = _("Further warnings were suppressed"); beep(); } diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc index b5aacaabf7203ef73c505b9554ff6e8fcb38db0d..121cdc846393687b9f9aa34a59238a9f199492a9 100644 --- a/syntax/nanorc.nanorc +++ b/syntax/nanorc.nanorc @@ -7,7 +7,7 @@ comment "#" icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|comment|magic|linter|i?color|extendsyntax).*$" # Keywords -icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cut|fill[[:space:]]+[[:digit:]]+|historylog|justifytrim|locking|morespace|mouse|multibuffer|noconvert|nohelp|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[[:digit:]]+|tabstospaces|tempfile|unix|view|wordbounds)\>" +icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cut|fill[[:space:]]+[[:digit:]]+|historylog|justifytrim|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[[:digit:]]+|tabstospaces|tempfile|unix|view|wordbounds)\>" icolor yellow "^[[:space:]]*set[[:space:]]+((function|key|number|status|title)color)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" "[[:space:]]+[[:digit:]]+$" icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|speller|statuscolor|titlecolor|whitespace|wordchars)[[:space:]]+" icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^([[:alpha:]]|[]0-9\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+(all|main|search|replace(with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"