summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parser.c16
-rw-r--r--txr.112
2 files changed, 24 insertions, 4 deletions
diff --git a/parser.c b/parser.c
index 48449dc8..8719b03d 100644
--- a/parser.c
+++ b/parser.c
@@ -581,8 +581,20 @@ val repl(val bindings, val in_stream, val out_stream)
break;
}
- if (strspn(line_u8, " \t") == strlen(line_u8))
- continue;
+ {
+ size_t wsp = strspn(line_u8, " \t\n\r");
+
+ if (line_u8[wsp] == 0) {
+ free(line_u8);
+ continue;
+ }
+
+ if (line_u8[wsp] == ';') {
+ lino_hist_add(ls, line_u8);
+ free(line_u8);
+ continue;
+ }
+ }
counter = succ(counter);
diff --git a/txr.1 b/txr.1
index 32799345..5e054e83 100644
--- a/txr.1
+++ b/txr.1
@@ -33259,8 +33259,16 @@ intercepts the exception and prints information about it preceded by
two asterisks and a space. These asterisks distinguish an exception from a
result value.
-If an empty line is entered, or a line containing only spaces and tabs,
-the prompt is repeated without incrementing the number.
+If an empty line is entered, or a line containing only spaces, tabs
+or embedded carriage returns or linefeeds, the prompt is repeated without
+incrementing the number. Such a line is not entered into the history.
+
+A line which only contains a \*(TL comment (optional spaces, tabs or embedded
+carriage returns or linefeeds, followed by a semicolon), also causes
+the prompt to be repeated without incrementing the number. However,
+such a line
+.B is
+entered into the history.
.SS* Ways to Quit