mirror of
https://github.com/samsonjs/elisp.js.git
synced 2026-04-27 15:07:47 +00:00
add a hide-prompt function
This commit is contained in:
parent
39a5b52e15
commit
f87cfe33d2
2 changed files with 7 additions and 1 deletions
|
|
@ -123,5 +123,9 @@ EL.definePrimitive('print', ['x'],
|
||||||
return EL.nil;
|
return EL.nil;
|
||||||
},
|
},
|
||||||
"print an expression");
|
"print an expression");
|
||||||
|
|
||||||
|
EL.definePrimitive('hide-prompt', ['yes-or-no'],
|
||||||
|
function(bool){ EL.hidePrompt = !EL.isNil(bool); },
|
||||||
|
"Call with T to hide the prompt or nil to show it.");
|
||||||
};
|
};
|
||||||
EL.initHook(EL._definePrimitives);
|
EL.initHook(EL._definePrimitives);
|
||||||
|
|
@ -31,7 +31,9 @@ EL.repl = function() {
|
||||||
var p = new EL.Parser(),
|
var p = new EL.Parser(),
|
||||||
e = new EL.Evaluator();
|
e = new EL.Evaluator();
|
||||||
while (true) {
|
while (true) {
|
||||||
|
if (!EL.hidePrompt) {
|
||||||
print("elisp> "); // i don't want a newline, grrrr
|
print("elisp> "); // i don't want a newline, grrrr
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
var line = readline();
|
var line = readline();
|
||||||
while (!line) {
|
while (!line) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue