[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH] startup: add option 'nopauses' to disable pausing a
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] [PATCH] startup: add option 'nopauses' to disable pausing after a warning |
Date: |
Tue, 7 Mar 2017 20:50:11 +0100 |
This addresses a followup of https://savannah.gnu.org/bugs/?50362.
Reported-by: Mike Frysinger <address@hidden>
---
src/nano.h | 3 ++-
src/rcfile.c | 3 ++-
src/winio.c | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/nano.h b/src/nano.h
index eba20ace..60fc8c6b 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 5c0c9439..3ede61f6 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 3f43d031..abff2d51 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();
}
--
2.11.0
- [Nano-devel] [PATCH] startup: add option 'nopauses' to disable pausing after a warning,
Benno Schulenberg <=